https://github.com/brybrophy/node-server-for-dotnet-devs
This is a starter for building web API's with TypeScript and Express.js.
https://github.com/brybrophy/node-server-for-dotnet-devs
postman typescript
Last synced: 11 months ago
JSON representation
This is a starter for building web API's with TypeScript and Express.js.
- Host: GitHub
- URL: https://github.com/brybrophy/node-server-for-dotnet-devs
- Owner: brybrophy
- Created: 2017-10-20T20:48:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-20T20:50:40.000Z (over 8 years ago)
- Last Synced: 2025-04-13T11:59:09.507Z (11 months ago)
- Topics: postman, typescript
- Language: TypeScript
- Homepage:
- Size: 46.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This is a starter for building web API's with typescript and express.
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.
### To get started:
- 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`.
### To start the app in development:
- Run `npm run start:dev`.
### To run the automated tests:
- Run `npm run test:all`.
### To manually test the app:
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!