Simple TS API exposing a single endpoint.
This is an API empowered by Express written in TypeScript, exposing a single endpoint.
It could have a safe list of URLs for CORS and use helmet to add basic security features.
The POST request body is validated using yup, and getResponse should yield different errors depending on its cause.
- Clone or download this repository;
- Install dependencies with
yarnornpm install; yarn serveornpm run serveto start the server listening to requests tolocalhost:3000
yarn test or npm test
This repo has unit tests for utility functions and uses supertest to simulate HTTP calls.
- typescript
- express
- cors
- helmet
- yup
- jest
- supertest