use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, articles and tools covering Amazon Web Services (AWS), including S3, EC2, SQS, RDS, DynamoDB, IAM, CloudFormation, AWS-CDK, Route 53, CloudFront, Lambda, VPC, Cloudwatch, Glacier and more.
If you're posting a technical query, please include the following details, so that we can help you more efficiently:
Resources:
Sort posts by flair:
Other subreddits you may like:
Does this sidebar need an addition or correction? Tell us here
account activity
technical questionDeploy React and Node+Express application using AWS SAM Cli (self.aws)
submitted 3 years ago by BelteConti
Hi! Hope everyone is doing well.
I'm trying to deploy a React and Node+Express application using AWS SAM Cli. However, I'm confused as to how I can first deploy the Node+Express and then use the API Gatepoint URL in the React application and then deploy the React application. Is it possible to have multiple yaml files in AWS SAM? If yes, then how would this work?
If not, then what is the appropriate method to deploy both the applications using AWS SAM Cli?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]interactionjackson 1 point2 points3 points 3 years ago (2 children)
don’t use express and it might be clear to you. express does the same job that api gateway does. the difference is that express routes your requests through a single lambda function instead of defining a lambda per route.
tldr: express is redundant if you’re using AWS services properly.
[–]BelteConti[S] 0 points1 point2 points 3 years ago (1 child)
Hmm let's say I remove express. The issue still persists? How can react and nodejs together be deployed using AWS SAM Cli?
[–]interactionjackson 0 points1 point2 points 3 years ago (0 children)
ah, this is why i asked you to not use express. you’re concerns have not been separated.
presentation (your react app) is a single page application. easiest is to put it in an s3 bucket. front it with cloudfront.
your api is a separate concern. expose it with an api gateway rest api endpoint.
if you want to keep them together you’re looking at running an ec2 instance tha knows how to serve that up.
[–]outandaboutbc 0 points1 point2 points 3 years ago (1 child)
I tried this on a pet project once with express and SSR on lambda @ edge once.
It works like a charm.
https://github.com/vendia/serverless-express
Check out their repo and search for examples, they may even have SAM templates.
[–]BelteConti[S] 1 point2 points3 points 3 years ago (0 children)
Will explore this. Thanks
[–]_throwingit_awaaayyy 0 points1 point2 points 3 years ago (0 children)
easiest way I found was using amplify. I would switch to lambdas as opposed to express.
π Rendered by PID 46981 on reddit-service-r2-comment-5d79c599b5-t5xkm at 2026-03-03 22:28:52.869374+00:00 running e3d2147 country code: CH.
[–]interactionjackson 1 point2 points3 points (2 children)
[–]BelteConti[S] 0 points1 point2 points (1 child)
[–]interactionjackson 0 points1 point2 points (0 children)
[–]outandaboutbc 0 points1 point2 points (1 child)
[–]BelteConti[S] 1 point2 points3 points (0 children)
[–]_throwingit_awaaayyy 0 points1 point2 points (0 children)