-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (20 loc) · 739 Bytes
/
index.js
File metadata and controls
25 lines (20 loc) · 739 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
const express = require("express");
const path = require('path');
const app = express();
const port = 3000;
const data = require('./data/elements.json');
const helpers = require("./modules/helpers");
app.use(express.static(__dirname + '/static'));
app.use(express.static(__dirname + '/node_modules/bootstrap/dist'));
app.use(express.static(__dirname + '/node_modules/bootstrap-icons'));
app.set('views', './views')
app.set('view engine', 'pug')
//app.get("/", (req, res) => {
// res.sendFile(path.join(__dirname, '/index.html'));
//});
app.get("/", (req, res) => {
res.render('index', { title: 'Toolbox for Continuous Learning', data: data })
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}!`);
});