This sample application demonstrates a basic CRUD REST API using NodeJS, TypeScript, and Serverless Framework
This project used this template from the Serverless Framework examples as a starting point
This project uses NodeJS 18. Install it first, then install dependencies with npm install
You can create, retrieve, update, or delete instrument rentals with the following commands:
POST /rentals
{
"name": "instrument name",
"description": "instrument description",
"type": "guitar"
}
GET /rentals
GET /rentals/{id}
PUT /rentals/{id}
{
"status": "rented"
}
DELETE /rentals/{id}
Prerequisite: make sure your AWS credentials are configured locally
- Deploy to dev stage with
npm run deploy:dev
- Deploy to prod stage with
npm run deploy:prod
- Deploy to an alternate stage with
npx sls deploy -s <stage>