Skip to content

Commit 0d4e93b

Browse files
author
Victor
committed
feat: add routes file and set the server to receive requests with json content
1 parent 3e14ab6 commit 0d4e93b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import 'dotenv/config';
22
import express from 'express';
3+
import { router } from './routes';
34

45
const app = express();
56
const SERVER_PORT = process.env.SERVER_PORT;
67

8+
app.use(express.json());
9+
app.use(router);
10+
711
app.listen(SERVER_PORT, () => console.log(`Server is running! Port: ${SERVER_PORT}`));

src/routes/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Router } from 'express';
2+
3+
const router = Router();
4+
5+
export { router };

0 commit comments

Comments
 (0)