It uses TypeScript, Inversion of Control, and Dependency Injection patterns to mimic the experience of building an API using C# and .NET.
Documentation is in progress, but every file should have comments to help explain everything.
- Clone the repo.
- Run
yarn install
. - Run
initdb pg
. - Run
Postgres -D pg
to start the db, then open a new tab in your terminal. - Run
createdb highseas
. - Run
createdb highseas_test
. - Run
echo "DATABASE_URL=postgres://localhost:5432/highseas" > .env
. - Run
npm run migrate:up:dev
.
- Run
npm run start:dev
.
- Run
npm run test:all
.
Because of the CSRF protection setup in the server, you must set Content-Type: application/json
in the request headers. Otherwise, you will get a 406 not acceptable
error. You can do this by using Postman to manually test the endpoints.
A working example of the api is running at http://high-seas-typescript-api.herokuapp.com/api/partners
;
Head over and try it out in Postman!