-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcontroller.js
More file actions
31 lines (26 loc) · 728 Bytes
/
controller.js
File metadata and controls
31 lines (26 loc) · 728 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
31
/*
defines an object which contains functions executed as callback
when a client requests for `index` paths in the server
*/
const controller = {
/*
executed when the client sends an HTTP GET request `/favicon.ico`
as defined in `../routes/routes.js`
*/
getFavicon: function (req, res) {
res.status(204);
},
/*
executed when the client sends an HTTP GET request `/`
as defined in `../routes/routes.js`
*/
getIndex: function (req, res) {
// render `../views/index.hbs`
res.render('index');
}
}
/*
exports the object `controller` (defined above)
when another script exports from this file
*/
module.exports = controller;