Closed arnabk closed 2 years ago
Maybe @fastify/aws-lambda could help?
does the /rest
route work?
Have you tried to set routePrefix: '/dev/documentation'
?
It may be the problem could be also somewhere in the getRedirectPathForTheRootRoute
function maybe for api-gw+lambda environments the staticPrefix is not correct.
@Eomm Should I post this in @fastify/aws-lambda. I spent several hours figuring out where could be the problem. I could only think that aws-lambda could be messing with it since it works as standalone server.
@adrai Yes /dev/rest
works. I tried with both routePrefix: '/dev/documentation',
and routePrefix: '/documentation',
, but it does not work.
Where is fastify-static serving the swagger content from?
I am going to close this and reopen here https://github.com/fastify/aws-lambda-fastify. Sounds like aws lambda fastify issue
You have already researched for similar issues?
Yes, searched keywords swagger+lambda/serverless does not return anything
What are you trying to achieve, or the steps to reproduce?
I am trying to enable swagger using serverlessJs. It works if I run a standalone server, but the same code does not generate swagger docs and routes when used with fastify/aws-lambda
index.js
App.js
serverless.yml (although might not be needed here)
Standalone version of the code that works
What was the result you received?
When I open http://localhost:3000/dev/documentation, it redirects to http://localhost:3000/dev/documentation/static/index.html with following content
What did you expect?
I was expecting it would show swagger default index.html page
Context