송용우

Update api directory

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