-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (23 loc) · 829 Bytes
/
index.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
const exp = require('express');
const app = exp();
const BP = require('body-parser');
const path = require('path');
const mongoose = require('mongoose');
const slashRoute = require('./routes/slash');
const slashPost = require('./routes/slashPost');
const slashDetails = require('./routes/slashDetails');
const slashApplication = require('./routes/slashApplication');
const slashViewapps = require('./routes/slashViewapps');
app.use(BP.urlencoded({extended:true}));
app.use(exp.static(path.join('public')));
app.set('view engine', 'ejs');
mongoose.connect('mongodb://127.0.0.1:27017/JobPortal');
app.use(slashRoute);
app.use(slashPost);
app.use(slashDetails);
app.use(slashApplication);
app.use(slashViewapps);
app.use((req,res) => {
res.status(404).send('<h1>Page Does Not Exists, error 404</h1>');
})
app.listen(3000);