-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
23 lines (19 loc) · 738 Bytes
/
Copy pathserver.js
File metadata and controls
23 lines (19 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const express = require("express");
const dotenv = require("dotenv");
dotenv.config({ path: "./config/config.env" });
const fileupload = require("express-fileupload");
const path = require("path");
// 내가 만든 파일 require는 이 아래에다가 넣자.
const users = require("./routes/users");
const posts = require("./routes/posts");
const follows = require("./routes/follows");
const app = express();
app.use(express.json());
app.use(fileupload());
app.use(express.static(path.join(__dirname, "public")));
app.use("/api/v1/users", users);
app.use("/api/v1/posts", posts);
app.use("/api/v1/follows", follows);
const PORT = process.env.PORT || 5760;
app.listen(PORT, console.log("서버 가동", PORT));
module.exports = app;