forked from inu-appcenter/InuMapusServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (20 loc) · 601 Bytes
/
Copy pathapp.js
File metadata and controls
27 lines (20 loc) · 601 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
const app = require('./config/express')();
app.use('/category',require('./routes/category/index'));
app.use('/icon',require('./routes/icon/index'));
app.use('/searchBar',require('./routes/searchBar/index'));
// error handler
app.use((req, res, next) => {
let err = new Error('Not Found');
err.status = 404;
next(err);
});
// render the error page
app.use((err, req, res, next) => {
console.log(err)
res.sendStatus(err.status || 500);
});
const port = app.get('key').port;
app.listen(port, () => {
console.log( 'Listening on port %d.', port);
});
module.exports = app;