1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-11 05:40:11 +02:00
copilot/backend/src/index.js

32 lines
557 B
JavaScript
Raw Normal View History

2016-10-20 15:36:24 +03:00
const path = require('path');
const express = require('express');
const st = require('st');
const app = express();
var mount = st({
path: path.join(__dirname, '../static'),
url: 'static/',
index: 'index.html',
dot: false,
passthrough: false,
gzip: true,
cors: false
});
app.use(mount);
app.get('/*', (req, res, next) => {
mount(Object.assign(req, {
sturl: '/static/index.html'
}), res, next);
});
app.listen(8000, (err, address) => {
if (err) {
throw err;
}
console.log('Server running at: http://localhost:8000');
});