Merge pull request #10688 from AllForNothing/relative

UI should use relative path for back-end APIs
This commit is contained in:
Will Sun 2020-02-11 18:06:42 +08:00 committed by GitHub
commit 647f11f26b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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