Browse Source

fix: update swagger base url with siteUrl and provide an option for custom url

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1845/head
Pranav C 3 years ago
parent
commit
894f6de2d7
  1. 16
      packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts

16
packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts

@ -15,6 +15,22 @@ async function swaggerJson(req, res) {
}); });
const swagger = await getSwaggerJSON(project, models); const swagger = await getSwaggerJSON(project, models);
swagger.servers = [
{
url: req.ncSiteUrl
},
{
url: '{customUrl}',
variables: {
customUrl: {
default: req.ncSiteUrl,
description: 'Provide custom nocodb app base url'
}
}
}
] as any;
res.json(swagger); res.json(swagger);
} }

Loading…
Cancel
Save