reduced a few lines of code
This commit is contained in:
parent
0380a8087f
commit
ded53cf45c
|
@ -36,7 +36,7 @@ function fixRawConfig(config) {
|
|||
}
|
||||
list.forEach(function (mod) {
|
||||
if (!mod.id) {
|
||||
mod.id = crypto.randomBytes(8).toString('hex');
|
||||
mod.id = crypto.randomBytes(4).toString('hex');
|
||||
updated = true;
|
||||
}
|
||||
});
|
||||
|
@ -153,7 +153,6 @@ async function checkConfigLocation(cwd, configFile) {
|
|||
, path.resolve(cwd, 'goldilocks.json')
|
||||
, path.resolve(cwd, 'etc/goldilocks/goldilocks.yml')
|
||||
, '/etc/goldilocks/goldilocks.yml'
|
||||
, path.resolve(cwd, 'goldilocks.yml')
|
||||
];
|
||||
|
||||
var ind;
|
||||
|
|
|
@ -421,12 +421,10 @@ module.exports.create = function (deps, conf) {
|
|||
app.use('/', isAuthorized, jsonParser);
|
||||
|
||||
app.use( '/config', makeCorsHandler());
|
||||
app.get( '/config', 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(domains)/:id/:name2(modules)', config.restful.readConfig);
|
||||
app.get( '/config/:group/:name(domains)/:id/:name2(modules)/:id2', config.restful.readConfig);
|
||||
app.get( '/config', config.restful.readConfig);
|
||||
app.get( '/config/:group', 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.post( '/config', config.restful.saveConfig);
|
||||
return app;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue