20 lines
480 B
JavaScript
20 lines
480 B
JavaScript
|
const express = require('express');
|
||
|
const app = express();
|
||
|
const port = 3000;
|
||
|
|
||
|
// Initialize the Twig template engine - this might get swapped for Twing later.
|
||
|
app.set('view engine', 'twig');
|
||
|
|
||
|
// Service static files from public/
|
||
|
app.use(express.static('public'));
|
||
|
|
||
|
// Load in route handlers
|
||
|
indexRoutes = require('./routes/index');
|
||
|
|
||
|
// Assign routes to handlers
|
||
|
app.get('/', indexRoutes.home);
|
||
|
|
||
|
app.listen(port, () => {
|
||
|
console.log(`Example app listening on port ${port}`)
|
||
|
});
|