main: handle theme from a dedicated module

This commit is contained in:
jean-emmanuel 2018-03-04 10:47:14 +01:00
parent ac5a90b4e1
commit 9e78279226
5 changed files with 85 additions and 58 deletions

View file

@ -5,6 +5,7 @@ var express = require('express')(),
Ipc = require('./ipc/server')
ipc = new Ipc(server),
settings = require('./settings'),
theme = require('./theme').init(),
zeroconf = require('./zeroconf'),
appAddresses = settings.read('appAddresses'),
clients = {}
@ -17,7 +18,7 @@ express.get('*', function(req, res){
if (req.path.indexOf('theme.css') != -1) {
res.set('Content-Type', 'text/css');
if (settings.read('theme')) {
res.send(new Buffer(settings.read('theme').join('\n')))
res.send(new Buffer(theme.get()))
} else {
res.send('')
}