This is a project for CDK development with TypeScript.
You’ll need to have an AWS account, as well as the AWS CLI and CDK, configured on your local machine. You will also need a CDK project initialized locally.
This project was developed based on the tutorials by [conermurphy]
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template
This project includes a REST API deployed on AWS API Gateway. The base URL for the API is: https://kkni2mdte8.execute-api.us-east-1.amazonaws.com/prod/
- Endpoint:
GET /posts
- Description: Retrieve all posts.
- Request:
- Headers:
x-api-key
: Your API key
- Headers:
- Response:
- Status Code: 200 OK
- Body: Array of post objects
- Endpoint:
GET /posts/{id}
- Description: Retrieve a specific post by ID.
- Request:
- Headers:
x-api-key
: Your API key
- Headers:
- Response:
- Status Code: 200 OK
- Body: { "title": "Example post 1", "description": "", "author": "me", "publicationDate": "some-date" }
- Endpoint:
POST /posts
- Description: Create a new post.
- Request:
- Headers:
x-api-key
: Your API key
- Body: Post object
- Headers:
- Response:
- Status Code: 200 OK
- Body: Success message
- Endpoint:
DELETE /posts/{id}
- Description: Delete a specific post by ID.
- Request:
- Headers:
x-api-key
: Your API key
- Headers:
- Response:
- Status Code: 200 OK
- Body: Success message
- Obtain an API key.
- Include the API key in the headers of your requests (
x-api-key: YOUR_API_KEY
).