-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
43 lines (34 loc) · 982 Bytes
/
app.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
36
37
38
39
40
41
42
43
// const express = require('express');
// const bodyParser = require('body-parser')
// const app = express()
// const routes = require('./routes')
// const config = require('../../config')
// // bodyparser
// app.use(bodyParser.urlencoded({ extended: false }));
// app.use(bodyParser.json());
// app.use(routes)
// // === BOILERPLATE ===
// // Catch and send error messages
// app.use((err, req, res, next) => {
// if (err) {
// console.error(err.message)
// if (!err.statusCode) {
// err.statusCode = 500
// } // Set 500 server code error if statuscode not set
// return res.status(err.statusCode).send({
// statusCode: err.statusCode,
// message: err.message
// })
// }
// next()
// })
// // 404
// app.use(function (req, res) {
// res.status(404).json({
// status: 'Page does not exist'
// });
// });
// const PORT = config.PORT || 3000
// app.listen(PORT, () => {
// console.log(`Listening on PORT: ${PORT}`);
// })