Showing
7 changed files
with
26 additions
and
2 deletions
jaksimsamil-server/.env
0 → 100644
1 | +SERVER_PORT=4000 | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
jaksimsamil-server/API.md
0 → 100644
File mode changed
jaksimsamil-server/index.js
0 → 100644
1 | +const express = require("express"); | ||
2 | +const morgan = require("morgan"); | ||
3 | +const app = express(); | ||
4 | +require("dotenv").config(); | ||
5 | + | ||
6 | +app.use( | ||
7 | + morgan("[:date[iso]] :method :status :url :response-time(ms) :user-agent") | ||
8 | +); | ||
9 | +app.use(express.json()); | ||
10 | +app.use(express.urlencoded({ extended: false })); | ||
11 | +app.use("/api", require("./api")); | ||
12 | + | ||
13 | +app.listen(process.env.SERVER_PORT, () => { | ||
14 | + console.log("Server is running on port", process.env.SERVER_PORT); | ||
15 | +}); |
... | @@ -5,9 +5,17 @@ | ... | @@ -5,9 +5,17 @@ |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "dependencies": { | 6 | "dependencies": { |
7 | "eslint-config-prettier": "^6.11.0", | 7 | "eslint-config-prettier": "^6.11.0", |
8 | - "express": "^4.17.1" | 8 | + "express": "^4.17.1", |
9 | + "fs": "^0.0.1-security", | ||
10 | + "morgan": "^1.10.0", | ||
11 | + "path": "^0.12.7" | ||
9 | }, | 12 | }, |
10 | "devDependencies": { | 13 | "devDependencies": { |
11 | - "eslint": "^7.1.0" | 14 | + "eslint": "^7.1.0", |
15 | + "nodemon": "^2.0.4" | ||
16 | + }, | ||
17 | + "scripts": { | ||
18 | + "start": "node src", | ||
19 | + "start:dev": "nodemon --watch src/ src/index.js" | ||
12 | } | 20 | } |
13 | } | 21 | } | ... | ... |
jaksimsamil-server/src/api/index.js
0 → 100644
File mode changed
jaksimsamil-server/src/index.js
0 → 100644
File mode changed
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment