-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve promise before registering middleware and exposing routes #351
Comments
I'll need a more complete example to help with this. What's your lambda handler look like? You'll need something like:
|
Thanks @brettstack, I'm trying to understand how to return the app as a promise so that I can fetch my secret. Take the following for example: If I have, as you suggested, for my
and for my
This configuration gives me the following error:
What am I missing here? Are there any examples that show a full example of what you posted above? |
Sorry, that should be |
May I know how do we use this new version with NestJS. Please note that I am in no hurry to use latest version but I would like to give it a try but facing issue.
But now I am getting errors as below
|
Please see https://github.com/vendia/serverless-express/blob/mainline/UPGRADE.md for info on upgrading. I haven't tested with Nest. Let me know if you hit any issues. If you could send a PR with a minimum Nest example, that'd be great! |
Will definitely do by end of this week. |
I see that you already have NestJS example. |
Yes we just merged this a few days ago. Let me know if you have any other issues. I'll close this issue for now. |
I need to fetch a secret from a secrets manager using an async request to use for my middleware, but I find that I get no response or a timed out one when I try and wrap my middleware and routes in a promise chain.
What is the best way to deal with async code that needs to be resolved before I expose my routes?
The text was updated successfully, but these errors were encountered: