From c932ca9d2b5cf16061e126bde0970e4b0351771b Mon Sep 17 00:00:00 2001 From: AllForNothing Date: Mon, 10 Feb 2020 15:37:09 +0800 Subject: [PATCH] UI should use relative path for back-end APIs Signed-off-by: AllForNothing --- src/portal/scripts/convert-yaml-to-json.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/portal/scripts/convert-yaml-to-json.js b/src/portal/scripts/convert-yaml-to-json.js index 5683705ef..9f393f216 100644 --- a/src/portal/scripts/convert-yaml-to-json.js +++ b/src/portal/scripts/convert-yaml-to-json.js @@ -17,4 +17,8 @@ if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir); } const swaggerObj = yaml.load(fs.readFileSync(inputFile, {encoding: 'utf-8'})); +// host is not needed as UI uses relative path for back-end APIs +if (swaggerObj.host) { + delete swaggerObj.host; +} fs.writeFileSync(outputDir + '/swagger.json', JSON.stringify(swaggerObj, null, 2));