From ea6e064e4248b4b3c4ecf7f653d271691d475058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 7 Oct 2019 14:08:59 +0200 Subject: [PATCH] Convert from v1 to api in routes config --- lib/server-options.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/server-options.js b/lib/server-options.js index 95a3dd7d..5dc7b72d 100644 --- a/lib/server-options.js +++ b/lib/server-options.js @@ -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 ]; }