app.js 498 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// express 설정 파일
import express from "express";
import fs from "fs";
import cookieParser from "cookie-parser";
import mainRouter from "./routes/index.js";

// fs.readdir('uploads', (error) => {
//     if (error) {
//         fs.mkdirSync('uploads');
//     }
// })

const app = express();

app.use(express.json());
// app.use('/uploads', express.static('uploads'))
app.use(express.urlencoded({ extended: true }));
app.use(cookieParser());

app.use("/api", mainRouter);

export default app;