Github Repo: github.com/mguay22/express-se... Serverless Docs: www.serverless.com/framework/... Express Docs: expressjs.com/ Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/
Thanks for the video, just a quick question in .yml file, when defining Handler it will go to the handler file by default in the main folder, ut if the handler files are in src folder , how we can do the connection with it.
Thanks for the video. But I wouldn't use Express in AWS Lambda. The reason is that it will cost me money in memory and time. I'd keep routing for AWS API Gateway instead. And I can still use middleware (auth for example) if needed.
when doing sls deploy i get the following error. Resource handler returned message: "Uploaded file must be a non-empty zip (Service: Lambda, Status Code: 400 Could you please help?
Hey Loco - great questions. In this example, we used only one lambda. We are proxying each and every endpoint to a single lambda which is what /{proxy}+ in our severless.yml is doing. However, you could just as easily create a new lambda function for each endpoint, or even a new lambda for each HTTP method! You'd just have to configure it as such in the serverless.yml. Fortunately (and to answer your question on scaling) - you shouldn't have to do this. The beauty of AWS Lambda is that is scales based on the number of invocations. So if we only receive one GET request, there is only one instance of the lambda spawned. However, if there is a massive burst of traffic that comes towards our API (lambda handler), AWS will automatically scale up the number of instances running our lambda to match the traffic. This is the great thing about this architecture, it is quick and easy to set up - but it also scales very easily thanks to the inner workings of AWS Lambda. You can read more about lambda function scaling, and how to configure it here: docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html
I followed the tutorial but I got this error : ApiGatewayResourceProxyVar - Resource's path part only allow a-zA-Z0-9._- and curly braces at the beginning and the end. (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException;
Hi Karim - thank you very much for posting your issue. I will look into it this weekend and get back to you. AWS may have changed their naming conventions for services, I'll have to take a look.
Good tutorial but with some reason I am getting 404. then I just went you your repo and cloned your project and got the same result 404 when I look at Lambda logs don't see any errors
Hi, I would only recommend this simpler architecture for smaller apps with a narrow focus. If you want to build bigger scaleable apps using Express, I recommend using a framework like Nest.js. I have several other videos about this subject.