송용우

Init server directory

SERVER_PORT=4000
\ No newline at end of file
File mode changed
const express = require("express");
const morgan = require("morgan");
const app = express();
require("dotenv").config();
app.use(
morgan("[:date[iso]] :method :status :url :response-time(ms) :user-agent")
);
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use("/api", require("./api"));
app.listen(process.env.SERVER_PORT, () => {
console.log("Server is running on port", process.env.SERVER_PORT);
});
......@@ -5,9 +5,17 @@
"license": "MIT",
"dependencies": {
"eslint-config-prettier": "^6.11.0",
"express": "^4.17.1"
"express": "^4.17.1",
"fs": "^0.0.1-security",
"morgan": "^1.10.0",
"path": "^0.12.7"
},
"devDependencies": {
"eslint": "^7.1.0"
"eslint": "^7.1.0",
"nodemon": "^2.0.4"
},
"scripts": {
"start": "node src",
"start:dev": "nodemon --watch src/ src/index.js"
}
}
......
This diff is collapsed. Click to expand it.