process admin keys at startup, instead of on demand
This commit is contained in:
parent
64c9438734
commit
322ceb7ea1
@ -169,8 +169,6 @@ if (config.privKeyAndCertFiles) {
|
||||
};
|
||||
}
|
||||
|
||||
app.get('/api/config', function(req, res){
|
||||
var host = req.headers.host.replace(/\:[0-9]+/, '');
|
||||
var admins = [];
|
||||
try {
|
||||
admins = (config.adminKeys || []).map(function (k) {
|
||||
@ -179,6 +177,10 @@ app.get('/api/config', function(req, res){
|
||||
return s[s.length-1].replace(/-/g, '/');
|
||||
});
|
||||
} catch (e) { console.error("Can't parse admin keys"); }
|
||||
|
||||
app.get('/api/config', function(req, res){
|
||||
// TODO precompute any data that isn't dynamic to save some CPU time
|
||||
var host = req.headers.host.replace(/\:[0-9]+/, '');
|
||||
res.setHeader('Content-Type', 'text/javascript');
|
||||
res.send('define(function(){\n' + [
|
||||
'var obj = ' + JSON.stringify({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user