Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • svdh/ocm-engine
1 result
Show changes
Commits on Source (3)
......@@ -35,3 +35,4 @@ ATTESTATION_SERVICE_HOST=0.0.0.0
PROOF_SERVICE_TCP_PORT=8884
PROOF_SERVICE_HOST=0.0.0.0
SWAGGER=false
......@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.11.1](https://code.vereign.com/gaiax/ocm/ocm-engine/compare/v1.11.0...v1.11.1) (2023-11-02)
### Bug Fixes
* separate swagger generation from server run ([efb63a9](https://code.vereign.com/gaiax/ocm/ocm-engine/commit/efb63a9b791e938df6cc782229f6b2d13a091d87))
## [1.11.0](https://code.vereign.com/gaiax/ocm/ocm-engine/compare/v1.10.0...v1.11.0) (2023-10-09)
......
This diff is collapsed.
......@@ -17,15 +17,19 @@ async function bootstrap() {
const port = process.env.AGENT_PORT || 3001;
app.enableShutdownHooks();
const config = new DocumentBuilder()
.setTitle("Agent")
.setDescription("Agent API")
.setVersion("1.0")
.build();
if (process.env.SWAGGER === "true") {
const config = new DocumentBuilder()
.setTitle("Agent")
.setDescription("Agent API")
.setVersion("1.0")
.build();
const document = SwaggerModule.createDocument(app, config);
fs.writeFileSync("./agent-swagger.json", JSON.stringify(document));
SwaggerModule.setup("api", app, document);
const document = SwaggerModule.createDocument(app, config);
fs.writeFileSync("./agent-swagger.json", JSON.stringify(document));
SwaggerModule.setup("api", app, document);
Logger.log(`Swagger file written`);
return process.kill(0);
}
await app.listen(port, "0.0.0.0");
Logger.log(
......
......@@ -38,17 +38,21 @@ async function bootstrap() {
app.enableShutdownHooks();
const config = new DocumentBuilder()
.setTitle("OCM Gateway")
.setDescription("OCM ENGINE GATEWAY API")
.setVersion("1.0")
.addServer(`http://${gatewayConfig.host}:${gatewayConfig.httpPort}`)
.build();
if (process.env.SWAGGER === "true") {
const config = new DocumentBuilder()
.setTitle("OCM Gateway")
.setDescription("OCM ENGINE GATEWAY API")
.setVersion("1.0")
.addServer(`http://${gatewayConfig.host}:${gatewayConfig.httpPort}`)
.build();
const document = SwaggerModule.createDocument(app, config);
fs.writeFileSync("./gateway-swagger.json", JSON.stringify(document));
SwaggerModule.setup("api", app, document);
const document = SwaggerModule.createDocument(app, config);
fs.writeFileSync("./gateway-swagger.json", JSON.stringify(document));
SwaggerModule.setup("api", app, document);
Logger.log(`Swagger file written`);
return process.kill(0);
}
const port = gatewayConfig.httpPort || 3000;
await app.listen(port, gatewayConfig.host);
......