Skip to content

Commit

Permalink
fix: Incorrect double negation in template
Browse files Browse the repository at this point in the history
Solves #11
  • Loading branch information
alesancor1 committed Feb 13, 2023
1 parent 99eca59 commit 6e1e8cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/server/index.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const app = express();
app.use(express.json({limit: '50mb'}));

const config = {
{{~#if oasFile.components.securitySchemes~}}
middleware: {
security: {
auth: {
Expand All @@ -51,14 +52,15 @@ const config = {
}
}
}
{{/if}}
}

{{#if options.installModule}}use({{options.installModule.moduleName}}){{/if}}
initialize(app, config).then(() => {
http.createServer(app).listen(serverPort, () => {
console.log("\nApp running at http://localhost:" + serverPort);
console.log("________________________________________________________________");
if (config.middleware.swagger?.disable !== false) {
if (!config?.middleware?.swagger?.disable) {
console.log('API docs (Swagger UI) available on http://localhost:' + serverPort + '/docs');
console.log("________________________________________________________________");
}
Expand Down
4 changes: 3 additions & 1 deletion templates/server/server.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const deploy = async () => {
app.use(express.json({limit: '50mb'}));

const config = {
{{~#if oasFile.components.securitySchemes~}}
middleware: {
security: {
auth: {
Expand All @@ -26,14 +27,15 @@ const deploy = async () => {
}
}
}
{{~/if~}}
}

{{#if options.installModule}}use({{options.installModule.moduleName}}){{/if}}
initialize(app, config).then(() => {
http.createServer(app).listen(serverPort, () => {
console.log("\nApp running at http://localhost:" + serverPort);
console.log("________________________________________________________________");
if (config.middleware.swagger?.disable !== false) {
if (!config?.middleware?.swagger?.disable) {
console.log('API docs (Swagger UI) available on http://localhost:' + serverPort + '/docs');
console.log("________________________________________________________________");
}
Expand Down

0 comments on commit 6e1e8cd

Please sign in to comment.