Hybrid NodeJS Server/Serverless API/Universal-React architecture Template. Code your API handlers using AWS Lambda syntax and bind your endpoints in serverless.yml. Since it's a NodeJS project, you can install any lib you want.
Run it anywhere!
- NodeJS 6+ installed
- AWS account with API credentials
- Serverless CLI installed
- Docker installed (optional)
Inside src/Serverless folder you will find all files containing AWS Lambda functions.
Inside src/View folder you will find React files.
There is a GET/POST example with a dumb authorizer step. The GET returns a page with universal-react.
Following serverless framework you can configure new endpoints in serverless.yml
NODE_ENV: # Define your deployment environment (e.g. production)
STATIC_PATH: # Define CDN root path (AWS S3 bucket URL)
DYNAMODB_TABLE: # Name of dynamoDB photos table
BUCKET_NAME: # Define AWS S3 bucket name
BUCKET_NAME=<your-bucket-name> npm run deploy:client
STATIC_PATH=<path-to-your-s3-bucket> DYNAMODB_TABLE=<name-of-dynamoDB-table> npm run deploy:backend
npm install
npm start
docker build -t express-serverless .
docker run -p 3000:3000 express-serverless
npm run dev:server
npm run dev:client
npm install
npm test