rafbcampos / express-ts

Simple TS API exposing a single endpoint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

express-ts

Simple TS API exposing a single endpoint.

Overview

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.

Running it locally

  • Clone or download this repository;
  • Install dependencies with yarn or npm install;
  • yarn serve or npm run serve to start the server listening to requests to localhost:3000

Testing

yarn test or npm test

This repo has unit tests for utility functions and uses supertest to simulate HTTP calls.

Technologies

  • typescript
  • express
  • cors
  • helmet
  • yup
  • jest
  • supertest

About

Simple TS API exposing a single endpoint


Languages

Language:TypeScript 91.6%Language:JavaScript 7.6%Language:Shell 0.7%