-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (20 loc) · 676 Bytes
/
index.js
File metadata and controls
24 lines (20 loc) · 676 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
const data = require('./data.js');
const machine = require('./machine.js')
const path = require("path");
const express = require('express');
const app = express();
var parsedData = data.parse();
var illustrateData = data.illustrate(parsedData, 100);
machine.learn(parsedData);
app.set("view engine", "pug");
app.set("views", path.join(__dirname, "views"));
app.use(express.static(path.join(__dirname, "public")));
app.set('port', (process.env.PORT || 5000))
app.get('/', function (req, res) {
res.render("example_grid", {
images: illustrateData
})
})
app.listen(app.get('port'), function () {
console.log('Example app listening on port ' + app.get('port'))
})