-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
22 lines (17 loc) · 602 Bytes
/
app.js
File metadata and controls
22 lines (17 loc) · 602 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const express = require('express');
const app = express();
const expressLayouts = require('express-ejs-layouts');
//Loading default portal assets and component's assets
app.use(express.static(__dirname + '/public/default/'));
app.use(express.static(__dirname + '/public/dist/'));
//EJS
app.use(expressLayouts);
app.set('view engine', 'ejs');
//Setting the routes
app.use('/', require('./routes/main'));
//404 Error handling
app.all('*', (req, res) => {
res.status(404).render('404');
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, console.log(`Server started on ${PORT}`));