-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathapp.js
More file actions
21 lines (17 loc) · 662 Bytes
/
Copy pathapp.js
File metadata and controls
21 lines (17 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import dotenv from 'dotenv';
import express from 'express';
import cors from 'cors';
import router from './src/routes/index.routes.js';
import ***REMOVED*** connDB ***REMOVED*** from './src/config/db.config.js';
dotenv.config();
const app = express();
connDB();
app.use(cors());
app.use(express.json());
app.use(express.urlencoded(***REMOVED*** extended: true ***REMOVED***));
app.use('/api', router);
const port = process.env.PORT || 4000;
app.get('/', (req, res) => res.send('<h1>Welcome to EasyExit API<h1>'));
app.listen(port, () =>
***REMOVED******REMOVED***console.log(`🚀 Server running on port http://localhost:$***REMOVED***port***REMOVED***/`)
);