forked from danielkhan/building-website-nodejs-express
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
35 lines (26 loc) · 848 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
32
33
34
35
const express = require('express');
const path = require('path');
const FeedbackService = require('./services/FeedbackService');
const SpeakersService = require('./services/SpeakerService');
const feedbackService = new FeedbackService('./data/feedback.json');
<<<<<<< Updated upstream
const speakersService = new SpeakersService('.data/speakers.json');
=======
const speakersService = new SpeakersService('./data/speakers.json');
>>>>>>> Stashed changes
const routes = require('./routes');
const app = express();
const port = 3000;
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, './views'));
app.use(express.static(path.join(__dirname, './static')));
app.use(
'/',
routes({
feedbackService,
speakersService,
})
);
app.listen(port, () => {
console.log(`Express server listening on port ${port}!`);
});