How to deploy Express Server on AWS Lambda

Поделиться
HTML-код
  • Опубликовано: 23 авг 2024
  • Trying to deploy an express server to AWS lambda can be difficult if you don't have a lot of experience with AWS services or if you have never used serverless-http. In this video, I walk you through deploying your express server to a Lambda function and explain the process to show how simple it can actually be.
    Tips:
    - When deploying the lambda function make sure your index.js file is in your projects root directory
    - Make sure you aren't using the base express route. API Gateway will not route this to our lambda function
    Resources:
    Github Repo: github.com/Vin...
    serverless-http: www.npmjs.com/...
    Express Docs: expressjs.com/...
    My github: github.com/Vin...
    My portfolio: www.vinibjazev...

Комментарии • 41

  • @alexandrepayet3106
    @alexandrepayet3106 Месяц назад +1

    Thx for this tutorial !! Migration from basic nodejs server to aws can't be more easy with your concise explanation !! 👏🏻

  • @GerardoRojasPacheco
    @GerardoRojasPacheco Год назад +6

    Excellent!!, you have saved me, I had several days trying to solve it... Thank you very much for your contribution
    Everything very easy and clear to understand and start up
    👋👋👋👋👍👍

  • @amoutsatsos
    @amoutsatsos 11 месяцев назад +2

    This was the tutorial I was looking for! You are a superstar!

  • @user-dg8zd8hc7h
    @user-dg8zd8hc7h 9 месяцев назад +1

    thank you for making this.
    making life easier with deploying super simple crud api

  • @Tim28259
    @Tim28259 8 месяцев назад +1

    best tutorial i saw about that topoc

  • @stareditz7960
    @stareditz7960 7 месяцев назад +1

    thank you so much. this was the simplest tutorial i found on youtube.

  • @tech3425
    @tech3425 5 месяцев назад +1

    Yes, I enjoyed the video. Thanks for asking, or rather hoping

  • @MrRaj-rz5po
    @MrRaj-rz5po 10 месяцев назад +3

    The deployment package of your Lambda function "hotelS3" is too large to enable inline code editing. However, you can still invoke your function.

  • @rajkiranm1285
    @rajkiranm1285 8 месяцев назад +1

    Awesome!! Thankyou!! got what I was looking for!!

  • @mackerel941
    @mackerel941 7 месяцев назад +1

    Thanks for you! This video solved my problem.

  • @karincaceres2537
    @karincaceres2537 7 месяцев назад +1

    It worked perfectly! Thanx a lot!!!

  • @eves.2825
    @eves.2825 Год назад +4

    This was super clear and helpful! Thank you :) Things seem to be connected on my end, but there's a CORS error that won't go away. any idea? (I enabled it in the gateway)

    • @eves.2825
      @eves.2825 Год назад +2

      I figured it out in the end , I had to add CORS headers when the response was being sent, and clear up my routes. This was really great thank you!

  • @Abdelmounim-edraak
    @Abdelmounim-edraak 4 месяца назад +1

    would someone explain why the base route doesn't work?

  • @MrMonkeyMan89
    @MrMonkeyMan89 2 месяца назад

    Great tutorial thanks! 👍

  • @surajshetty8429
    @surajshetty8429 Год назад +2

    Great bro

  • @slov1ker583
    @slov1ker583 9 дней назад

    This is weird I deployed my express server on vercel cloud serverless once and it was working without any issue. Am I to assume that they change the code base automatically?

  • @luisnannini
    @luisnannini Год назад +2

    Hi Vini, thanks for the video! Question, I have a simple Node project that connects to the Binance API using a WebSocket, I want to use AWS to keep the Node project running in the cloud instead of my PC. What should I use? Just a Lambda Function? thanks

    • @dineshpr
      @dineshpr Год назад +1

      You can use pm2 I guess

    • @luisnannini
      @luisnannini Год назад

      @@dineshpr thanks for the response. I actually used ec2 and it does the job! Idk if pm2 is more suitable

    • @codewithvini1644
      @codewithvini1644  9 месяцев назад +3

      As a general rule, Lambda is mainly used for short operations. So occasionally if you need to run some code and it only takes a minute to run this is a perfect use case. If it needs to run for long periods of time (greater than 15 min) or always needs to run then we would want to something like a EC2 instance.

  • @wingsaber629
    @wingsaber629 Месяц назад +1

    How do you serve the frontend with an express app?

  • @sk9647
    @sk9647 7 месяцев назад

    I have a express and postgres backend. The api requires jwt token in headers will this way work

  • @Jordan-er9bx
    @Jordan-er9bx 4 месяца назад

    I see serverless-http is no longer being maintained?

  • @shivShaktitech
    @shivShaktitech 8 месяцев назад

    hi i have a question can we deploy our old sequelize orm project to lamdba?

  • @MrPakssa
    @MrPakssa 8 месяцев назад

    Hi Vini,
    I'm getting statusCode 404 error I did same as of you, could you please help me to fix it,
    "headers" : {
    "x-powered-by": "Express",
    }

  • @junjiegong9957
    @junjiegong9957 2 месяца назад

    "message": "Internal server error"
    Any help?

    • @wingsaber629
      @wingsaber629 Месяц назад

      Same error. Error does not help at all..

  • @cimoran2924
    @cimoran2924 9 месяцев назад

    Hello! I'm trying to deploy my server. I'm using Prisma, express with routes and controllers with it.
    For my client-side i'm using React.
    Does this deployment method works for me?

    • @codewithvini1644
      @codewithvini1644  9 месяцев назад

      Yeah you shouldn't run into any issues using prisma its just a tool that makes managing your database a little easier. If you run into issues let me know and I could try to deploy an API using it.

  • @mohammadshahzaib3275
    @mohammadshahzaib3275 3 месяца назад

    file size limit is coming

  • @innocentkumwenda8139
    @innocentkumwenda8139 Год назад +1

    Super hero🦸

  • @laraibanwar1618
    @laraibanwar1618 Год назад +3

    i am getting internal server error

    • @abdulbasitimtiaz
      @abdulbasitimtiaz Год назад

      same here have you solved this

    • @codewithvini1644
      @codewithvini1644  Год назад

      @@abdulbasitimtiaz Can you provide a little more information on the error? There is a chance that something is broken in your express server. I would make sure it works locally before trying to deploy it to Lambda.

    • @codewithvini1644
      @codewithvini1644  Год назад

      @laraibanwar1618 did you ever get past your issue?

    • @tomilayoafolabi1057
      @tomilayoafolabi1057 Год назад

      This video was really helpful for me. When I got the internal server error, I fiddled with a lot of setting but what eventually worked for me was increasing the timeout settings on my Lambda function. The default is 3secs when you create a lambda function. So I went to the "Configuration" tab >> clicked "Edit" and increased the timeout settings to 10s. This can be increased as needed. But in my case, my application was previously timing out within 3secs which was causing the internal server error.
      In addition, I moved my environment variables to the Lambda functions interface instead of having them in a .env file within my application.

    • @kris_7324
      @kris_7324 8 месяцев назад

      If you using .js code from repo , notice that it has several changes, for me a walkaround was simply create function URL in aws Lambda configuration.

  • @arioliveira4811
    @arioliveira4811 Год назад

    top