const fs = require('fs'); const express = require('express'); const pug = require('pug'); const app = express(); const port = 8000; app.set('view engine', 'pug'); app.get('/', (req, res) => { fs.readFile('assets/data.json', 'utf-8', (err, data) => { if (err != null) { console.log("Error: " + e); } let parsed = JSON.parse(data); res.render('index', parsed); }); }); app.use('/static', express.static('static')); app.listen(port, () => { console.log(`Example app listening on port ${port}!`) })