-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (24 loc) · 837 Bytes
/
index.js
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
26
const http = require('http');
const express = require('express');
const path = require('path');
const app = express();
app.use(express.json());
app.use(express.static("express"));
// default URL for website
app.get('/', function(req,res){
res.sendFile(path.join(__dirname+'/dist/index.html'));
//__dirname : It will resolve to your project folder.
});
// Serve static files from /browser
app.use('/static', express.static('dist'));
app.use(function (req, res, next) {
res.status(404).send("Sorry can't find that!")
});
const server = http.createServer(app);
const port = 3000;
server.listen(port);
console.debug('Server listening on port ' + port);
var html_tablify = require('html-tablify');
var dimensions = require('./module-dimensions.json');
var html_data = html_tablify.tablify(dimensions);
//console.log(html_data);