Convert from v1 to api in routes config

This commit is contained in:
Daniel García Aubert 2019-10-07 14:08:59 +02:00
parent 55aad4254c
commit ea6e064e42

View File

@ -81,7 +81,12 @@ const routesConfig = global.environment.routes || {
}]
};
if (!Array.isArray(routesConfig.api)) {
if (routesConfig.v1 && !Array.isArray(routesConfig.v1)) {
routesConfig.api = [ routesConfig.v1 ];
delete routesConfig.v1;
}
if (routesConfig.api && !Array.isArray(routesConfig.api)) {
routesConfig.api = [ routesConfig.api ];
}