Deployed to AWS Lambda
Default deployment url: ssr.effector.dev
Defined in src/server
Implemented as three lambda functions:
- Api: provides access to users' data through rest api.
POST ssr.effector.dev/apifor list of all user namesPOST ssr.effector.dev/api/{user}for particular user info
- SSR: server side rendering of application. Makes http requests to api lambda and renders application with given results.
GET ssr.effector.devwill fetch all user names and redirect user to random user pageGET ssr.effector.dev/user/{user}will fetch user info and render react app with it
- Static: lambda for hosting static client assets from url
ssr.effector.dev/static/*
Configuration
-
Add your domain name and certificate ARN to
domain.json. It will be used by serverless framework to deploy application and by lambda functions to make requests. Note that certificate should be inus-east-1region -
Call
npx serverless create_domainto create API Gateway custom domain and then you will be ready to deploy application
Deploy
yarn && yarn deployThis will build client app and each of the lambda functions and will deploy everything to AWS lambda via serverless framework