- Wrapped the application using the
serverless-http
module. - Exported the app as a handler for AWS Lambda.
- Zipped the entire backend code.
- Created a Lambda function in AWS using the latest Node.js runtime.
- Uploaded the zipped backend code.
- Created a REST API in API Gateway.
- Added a resource and configured it as a proxy resource to forward all requests and associated request bodies to the Lambda function.
- Enabled CORS in API Gateway.
- Integrated the Lambda function with the proxy resource.
- Deployed the API.
- Updated the Lambda function's timeout setting from the default (3 seconds) to 60 seconds to ensure sufficient time for operations to complete.
- Created an S3 bucket.
- Named the bucket and enabled public access to allow users to access the frontend application.
- Updated the backend URL in the
config.js
file after deploying the backend. - Built the frontend application.
- Uploaded the build version to the S3 bucket.
- Created a CloudFront distribution.
- Set the origin domain to the S3 bucket.
- Configured the Viewer Protocol Policy to redirect HTTP to HTTPS.
- Ensured that both the backend and frontend were properly connected.
- Validated API responses and frontend rendering.
- Ensure proper IAM roles and permissions are set for Lambda, API Gateway, and S3.
- Regularly monitor API Gateway and Lambda logs for debugging and performance optimization.
- Use AWS CloudWatch for monitoring and alerts.