-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (23 loc) · 702 Bytes
/
app.js
File metadata and controls
30 lines (23 loc) · 702 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
28
29
30
/*
* Title: Project Initial File
* Description: Initial file to start the application
* Author: Minhajul Karim
* Date: 4 Aug 2021
*/
// Dependencies
const express = require('express');
const exphbs = require('express-handlebars');
const customerRouter = require('./routes/customers');
const app = express();
// Handlebars settings
app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');
// Index route
app.get('/', (req, res) => {
res.sendStatus(200);
});
// Settings to parse body of a POST request
app.use(express.urlencoded({ extended: true }));
// Use a separate router for the paths following /customers
app.use('/customers', customerRouter);
module.exports = app;