-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathserver.js
26 lines (22 loc) · 802 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* eslint-disable linebreak-style */
// eslint-disable-next-line linebreak-style
// eslint-disable-next-line import/extensions
require('./db/mongoose.js');
const cors = require('cors');
const express = require('express');
require('dotenv').config();
const app = express();
const port = process.env.PORT || 5000;
app.use(express.json());
app.use(cors());
// eslint-disable-next-line linebreak-style
const userRoute = require('./routes/user');
const projectRoute= require('./routes/project');
app.use(userRoute);
app.use(projectRoute);
// eslint-disable-next-line no-console
app.listen(port, () => console.log(`[+] Server is running on http://localhost:${port} `)); //
// eslint-disable-next-line linebreak-style
app.get('/express_backend', (req, res) => {
res.send({ express: 'Helloworld' });
});