1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/server.js

22 lines
588 B
JavaScript
Raw Normal View History

2015-06-08 15:24:58 +02:00
var express = require('express');
2015-06-08 17:20:08 +02:00
var compression = require('compression')
2015-06-08 15:24:58 +02:00
var app = express();
2015-06-08 17:26:27 +02:00
app.use(compression());
2015-06-08 17:20:08 +02:00
2015-06-08 15:24:58 +02:00
app.use('/static/js', express.static(__dirname + '/build/js'));
app.use('/static/css', express.static(__dirname + '/build/css'));
app.use('/static/fonts', express.static(__dirname + '/build/fonts'));
app.use('/static/thirdparty/', express.static(__dirname + '/node_modules'));
app.get(/.*/, function(req, res) {
res.sendFile(__dirname + '/index.html');
});
if (require.main === module) {
app.listen(process.env.PORT || 4000);
}
module.exports.app = app;