question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m submitting a…


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Swagger endpoint is not found.

Expected behavior

Html response generated by swagger-ui.

Minimal reproduction of the problem with instructions

Here is an example I use in my project.

What is the motivation / use case for changing the behavior?

I’d like to generate swagger documents based on my modules and endpoints, but I cannot.

Environment


"@nestjs/common": "^5.4.0",
"@nestjs/core": "^5.4.0",
"@nestjs/swagger": "^2.5.1",
"aws-serverless-express": "^3.3.5",
"express": "^4.16.4",

 
For Tooling issues:
- Node version: 8.10  
- Platform: Mac 


Others:
I run my environment with serverless and serverless-offline plugin

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13

github_iconTop GitHub Comments

5reactions
plorencrstitcommented, Apr 22, 2020

I had the same problem before with typeorm. My solution was to manually listed entities in the configuration file. So I have two kind of settings.

  entities: [`${__dirname}/../**/*.entity{.ts,.js}`],
  ...typeOrmConfigGeneral,
};

export const typeOrmConfigServerless: TypeOrmModuleOptions = {
  entities: [
    Category,
    Comment,
    Discussion,
  ],
  ...typeOrmConfigGeneral,
};

I choose the configuration based on some env.

Do you use typeorm?

5reactions
jtmthfcommented, Mar 26, 2019

@csakbalint I just ran into this the other day. The problem is that given a swagger path of swagger, swagger-ui-express serves its html file from /swagger/ and will redirect if the request path is /swagger. Unfortunately API Gateway strips the trailing slash from the request path so you have to add it back with the block below.

if (event.path === '/swagger') {
  event.path = '/swagger/';
}

This cannot be done as a middleware as req.path from express is a getter and will throw an error if you try to overwrite it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · serverless/serverless - GitHub
Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more!
Read more >
Serverless Challenges And Fixes | Knowledge Base - Dashbird
Serverless Challenges and Solutions · Performance Problems of Serverless · Monitoring and DevOps challenges · Security Risks · Vendor Lock-in · Cost at...
Read more >
Why the Serverless Revolution Has Stalled - InfoQ
The big problem with serverless for server applications is state. You can't reduce all computations to simple stream processing. Oftentimes, ...
Read more >
Serverless and Deployment Issues - Paul Johnston - Medium
Serverless and Deployment Issues. Deploying to the cloud is sometimes easy and sometimes hard. There are a number of things that need to...
Read more >
Considerations when using Amazon Redshift Serverless
There's no interruption for existing connection or query execution when Amazon Redshift switches versions. New connections will always connect and work with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found