-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
31 lines (24 loc) · 872 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
27
28
29
30
31
const express = require('express')
const cors = require('cors')
const app = express()
const port = 5000
const path= require('path');
var publicDir=path.join(__dirname,'/public');
app.use(express.static(publicDir));
app.use(express.json())
app.use(express.urlencoded({extended: true}))
app.use(cors())
const connectDB = require('./config/db');
connectDB();
app.set('view engine', 'ejs')
const homeRouter =require('./routes/home')
const newUserRouter =require('./routes/new_user');
const addEventRouter =require('./routes/add_event');
const loginRouter =require('./routes/login');
const updateRouter =require('./routes/update');
app.use('/',homeRouter)
app.use('/new_user', newUserRouter)
app.use('/add_event', addEventRouter)
app.use('/login', loginRouter)
app.use('/update', updateRouter)
app.listen(port, () => console.log(`Server has started on port : ${port}`))