Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const path = require('path');
- const port = 3000;
- const app = express();
- app.set('views', path.join(__dirname, 'views'));
- app.set('view engine', 'ejs');
- app.get('/', function(req, res, next) {
- res.render('index', {
- title: 'I lied'
- });
- });
- app.use(function(err, req, res, next) {
- res.locals.message = err.message;
- res.locals.error = req.app.get('env') === 'development' ? err : {};
- res.status(err.status || 500);
- res.render('error');
- });
- app.listen(port, () => console.log(`App listening on port ${port}`));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement