Express API template written in in TypeScript. It uses tslint for static analysis, Prettier for code formatting, Jest for running tests, and Supertest for integration testing. Configured to be deployable to Heroku.
It's recommended to use nvm to manage your Node versions.
Set the correct Node version with nvm install && nvm use
.
Install dependencies with yarn install
.
All configs go to config/config.ts
. You can enter ENV variables to .env
-file for local environment.
Define routes in app/app.ts
. Use common REST conventions.
Add controller logic to app/contollers
directory. ie. GET /foo
to app/contollers/getFoo.ts
.
Separate other code to proper directories or put common code to app/modules
.
Add tests to same directories as the code. ie. Tests for app/controllers/getFoo.ts
goes to test/controllers/getFoo.ts
.
Run tests with yarn test
or in watch mode with yarn watch:test
.
Run static analysis and linters with yarn lint
.
Start application with yarn start
.
Start application in watch mode with yarn s
.