송용우

Update api directory

......@@ -21,7 +21,7 @@
| group | description | method | URL | Detail | Auth |
| ------- | ------------------------ | ------ | -------------------------- | -------- | --------- |
| user | 유저 등록 | POST | api/user | 바로가기 | JWT Token |
| user | 유저 삭제 | DEELTE | api/user:id | 바로가기 | JWT Token |
| user | 유저 삭제 | DELETE | api/user:id | 바로가기 | JWT Token |
| user | 특정 유저 조회 | GET | api/user:id | 바로가기 | None |
| user | 전체 유저 조회 | GET | api/user | 바로가기 | JWT Token |
| friend | 유저 친구 등록 | POST | api/friend | 바로가기 | JWT Token |
......
......@@ -2,6 +2,7 @@ const express = require("express");
const morgan = require("morgan");
const mongoose = require("mongoose");
const app = express();
const api = require("./src/api");
require("dotenv").config();
const { SERVER_PORT, MONGO_URL } = process.env;
app.use(
......@@ -9,8 +10,7 @@ app.use(
);
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use("/api", require("./api"));
app.use("/api", api);
mongoose
.connect(MONGO_URL, { useNewUrlParser: true, useFindAndModify: false })
.then(() => {
......
const express = require("express");
const router = express.Router();
router.post("/login");
router.get("/logout");
module.exports = router;
const express = require("express");
const router = express.Router();
router.post("/");
router.delete("/:id");
router.get("/:id");
router.get("");
module.exports = router;
const express = require("express");
const app = express();
const auth = require("./auth");
const friend = require("./friend");
const notify = require("./profile");
const user = require("./user");
const profile = require("./profile");
app.use("/auth", auth);
app.use("/friend", friend);
app.use("/notify", notify);
app.use("/user", user);
app.use("/profile", profile);
module.exports = app;
......
const express = require("express");
const router = express.Router();
router.post("/slack");
module.exports = router;
const express = require("express");
const router = express.Router();
router.post("/solved:id");
router.get("/solvednum:id");
router.get("recommendps:id");
module.exports = router;
const express = require("express");
const router = express.Router();
router.post("/");
router.delete("/:id");
router.get("/:id");
router.get("");
module.exports = router;