UI should use relative path for back-end APIs

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
AllForNothing 2020-02-10 15:37:09 +08:00
parent 8a74fcb074
commit c932ca9d2b

View File

@ -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));