Note: This project uses dummy AWS credentials for local testing. In production, be sure to use valid AWS credentials.
- Docker (to run DynamoDB Local)
- Node.js and npm
- AWS CLI (for creating the DynamoDB table in local mode)
- Git
-
Install Dependencies
npm install
-
Configure Environment Variables
AWS_ACCESS_KEY_ID=dummy AWS_SECRET_ACCESS_KEY=dummy AWS_REGION=us-east-1 DYNAMODB_TABLE_NAME=TextTable-dev DYNAMODB_ENDPOINT=http://localhost:8000 IS_OFFLINE=true
-
Start DynamoDB Local
docker compose up
-
Create the DynamoDB Table
aws dynamodb create-table \ --table-name TextTable-dev \ --attribute-definitions AttributeName=id,AttributeType=S \ --key-schema AttributeName=id,KeyType=HASH \ --billing-mode PAY_PER_REQUEST \ --endpoint-url http://localhost:8000 \ --region us-east-1
To verify the table was created, run:
aws dynamodb list-tables --endpoint-url http://localhost:8000 --region us-east-1-
Start the Serverless Application
npm run start