-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (21 loc) · 732 Bytes
/
index.js
File metadata and controls
27 lines (21 loc) · 732 Bytes
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
//Importing the required modules
const express = require('express');
const path = require('path');
const exphbs = require('express-handlebars');
//Creating a application using express
const app = express();
//Configuring the template engine and setting it up
app.engine('.hbs', exphbs({extname: '.hbs'}));
app.set('view engine', '.hbs');
//Specifing port to listen on
const port = 3000;
//Creating the endpoints
// app.get('/', (req, res) => {
// console.log('Hey / endpoint is hit');
// });
//Using the endpoints from the routes
app.use('/', require(path.join(__dirname, './routes/movieServer.js')));
//Listening to specific port
app.listen(port, () => {
console.log(`Server started on http://localhost:${port}`);
})