theming: send themes directly through http requests

This commit is contained in:
jean-emmanuel 2017-06-21 20:16:48 +02:00
parent 298ac51f67
commit 63a96e1c58
4 changed files with 7 additions and 14 deletions

View file

@ -13,7 +13,12 @@ express.get('/', function(req, res){
res.sendFile(path.resolve(__dirname + '/../browser/index.html'))
})
express.get('*', function(req, res){
res.sendFile(path.resolve(__dirname + '/../browser' + req.path))
if (req.path.indexOf('theme.css') != -1 && settings.read('theme')) {
res.set('Content-Type', 'text/css');
res.send(new Buffer(settings.read('theme')))
} else {
res.sendFile(path.resolve(__dirname + '/../browser' + req.path))
}
})
server.listen(settings.read('httpPort'))