-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Use with NestJS #115
Comments
maybe @cefamax can help? btw: if an old version of aws-lambda-fastify worked, the newest version should still work |
Hi, Yes, old version works, but with old versions of nest. Thanks Rafael. |
Sorry, I'm not a nest user, you may try to ask at the nest community or stackoverflow. |
Yeah... I already tried :-( |
hi @rbgfloripa, I write you the lambda.ts file contents. I use in production "aws-lambda-fastify": "^2.2.0" nodejs 16.x. interface NestApp { let cachedNestApp: NestApp; async function bootstrapServer(): Promise {
} export const handler = async (event: APIGatewayProxyEvent, context: Context): Promise => {
}; |
Thanks a lot man. |
Anyone using v3 with nestjs? |
@cefamax I was able to get my fastify/mercurius graphql app running locally through I don't know where Nest is trying to write to the lambda file system but happens right after |
@Jwagner347 I have no idea what it could be, with the information you wrote. Nest shouldn't write anything to that folder. You could try building a clean nestjs application to see if it works in aws and then add the other components to check if anything outside of nest can give that problem. |
aws-samples/aws-lambda-elixir-runtime#7
|
@Uzlopak I know you can only write to |
@cefamax I was able to figure it out. It's a GraphQL application, and I was using Thanks for your help, the code you initially posted helped me a lot to get up and running with fastify/mercurius in lambda. One thing I don't understand though is you are caching the proxy in addition to the app. Everywhere else I see proxy is just called directly. What is the reason for this? |
Can you improve the readme.md to persist that knowledge? |
@Jwagner347 I had read a comment by @mcollina where he recommends doing it, but now I can't find it to send it to you. However I have been using this system for several months, I have never had any problems. |
In most of the server-less environment, By using a variables cache, it will minimize the cold-start time of |
@climba03003 but why not do it like this:
Why cache proxy separate from the bootstrapped app? I would think that if one variable was removed from lambda cache, all variables would since you say it is determined by how long the environment spin down is set for. I am not trying to be pedantic, genuinely trying to understand where I may be missing something. |
@Jwagner347 I understand what you mean. It seems to me that the code you wrote is better than what I had written and the same result is achieved. Thank you! |
@Uzlopak I have a PR in that updates the Readme. I combined the suggestions and information from @cefamax and @climba03003, so let me know if I should change anything there. |
Just updating here that the latest version of Nest requires some updates to the code in this issue:
I do think this should be somewhere on the web but I'm not sure if it belongs in Nest or here. To be honest, if you are worried about noisiness of the documentation, this is pretty sparse compared to Nest's documentation so it wouldn't be too noisy here comparatively. At the same time, I find their serverless documentation to be a bit underwhelming. |
Looks like I'm still running into a problem: My set up is using SST to deploy a containerized Nest.js application using this plugin. There's a demo repo here. I get the following error when I hit the Lambda URL:
Perhaps using |
Prerequisites
Issue
Hi all,
Does anyone already use it in production with NestJS?
Is it possible to send me an example?
I searched and didn't find any information about this.
The only article I found (on Medium) uses old versions.
TIA,
Rafael.
The text was updated successfully, but these errors were encountered: