reduced a few lines of code

This commit is contained in:
tigerbot 2017-10-05 18:10:59 -06:00
parent 0380a8087f
commit ded53cf45c
2 changed files with 5 additions and 8 deletions

View File

@ -36,7 +36,7 @@ function fixRawConfig(config) {
} }
list.forEach(function (mod) { list.forEach(function (mod) {
if (!mod.id) { if (!mod.id) {
mod.id = crypto.randomBytes(8).toString('hex'); mod.id = crypto.randomBytes(4).toString('hex');
updated = true; updated = true;
} }
}); });
@ -153,7 +153,6 @@ async function checkConfigLocation(cwd, configFile) {
, path.resolve(cwd, 'goldilocks.json') , path.resolve(cwd, 'goldilocks.json')
, path.resolve(cwd, 'etc/goldilocks/goldilocks.yml') , path.resolve(cwd, 'etc/goldilocks/goldilocks.yml')
, '/etc/goldilocks/goldilocks.yml' , '/etc/goldilocks/goldilocks.yml'
, path.resolve(cwd, 'goldilocks.yml')
]; ];
var ind; var ind;

View File

@ -423,10 +423,8 @@ module.exports.create = function (deps, conf) {
app.use( '/config', makeCorsHandler()); app.use( '/config', makeCorsHandler());
app.get( '/config', config.restful.readConfig); app.get( '/config', config.restful.readConfig);
app.get( '/config/:group', config.restful.readConfig); app.get( '/config/:group', config.restful.readConfig);
app.get( '/config/:group/:name(modules|domains)', config.restful.readConfig); app.get( '/config/:group/:name(modules|domains)/:id?', config.restful.readConfig);
app.get( '/config/:group/:name(modules|domains)/:id', config.restful.readConfig); app.get( '/config/:group/:name(domains)/:id/:name2(modules)/:id2?', config.restful.readConfig);
app.get( '/config/:group/:name(domains)/:id/:name2(modules)', config.restful.readConfig);
app.get( '/config/:group/:name(domains)/:id/:name2(modules)/:id2', config.restful.readConfig);
app.post( '/config', config.restful.saveConfig); app.post( '/config', config.restful.saveConfig);
return app; return app;
}; };