forked from vyas0189/CougarCS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
26 lines (22 loc) · 949 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
const express = require('express');
const morgan = require('morgan');
const cors = require('cors');
if (process.env.NODE_ENV !== 'production') require('dotenv').config();
const connectDB = require('./config/db');
connectDB();
const app = express();
app.use(cors());
app.use(morgan('dev'));
app.use(express.json({ extended: false }));
const PORT = process.env.PORT || 4000;
app.get('/', (req, res) => res.send('Home Page'));
app.use('/api/admin', require('./routes/api/admin'));
app.use('/api/auth', require('./routes/api/auth'));
app.use('/api/member', require('./routes/api/member'));
app.use('/api/officers', require('./routes/api/officer'));
app.use('/api/profile', require('./routes/api/profile'));
app.use('/api/resume', require('./routes/api/resume'));
// app.use('/api/event', require('./routes/api/event'));
app.listen(PORT, () => {
console.log(`Listening to port ${PORT} URL: http://localhost:${PORT}`);
});