https://github.com/joshuatoth/serverless-api-typescript-template
A template for a Serverless API using Typescript and Jest
https://github.com/joshuatoth/serverless-api-typescript-template
Last synced: about 1 year ago
JSON representation
A template for a Serverless API using Typescript and Jest
- Host: GitHub
- URL: https://github.com/joshuatoth/serverless-api-typescript-template
- Owner: JoshuaToth
- Created: 2019-07-15T08:20:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T13:58:04.000Z (over 3 years ago)
- Last Synced: 2025-03-28T07:51:10.453Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 650 KB
- Stars: 12
- Watchers: 0
- Forks: 8
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless API: Typescript and Jest Template
A Serverless API template using Typescript and Jest.
This setup uses AWS as the provider.
To use your own provider, edit the `serverless.yml` as needed.
The endpoint for the tests to run against will also need to be set to be more specific to your provider.
## Getting up and running
First install `serverless` and get that up and running. documentation [here](https://serverless.com/framework/docs/providers/aws/guide/quick-start/).
You can use the standard `sls` commands or utilise the npm scripts in the project.
Then:
```
npm install
```
## Deployment - Dev
```
npm run deploy
```
## Deployment - Prod
```
npm run deploy:prod
```
## To remove:
```
npm run remove
```
# API interactions
The API url can be found either the console output, or programatically accessed via the `.serverless/output.json` object.
## GET: Healthcheck
Test the service is up
```
/healthcheck
```
# Testing
This template uses Jest (Typescript) to run its tests.
To test, first deploy the application to your desired AWS stack.
Then run
```
npm run test
```
This will use the generated API url to automatically test the application.