- Clone this repository
- Install the modules using
npm install
oryarn
- Create the build using
tsc
- Put the database (postgres) url in a
.env
file with the same structure as.env.sample
- To run migrations, run the command
npm run migrate
oryarn migrate
- Start the server using
npm start
oryarn start
- GET /pets
- Get all pets
- GET /pets/:id
- Get a single pet
- POST /pets/new
- Create a new pet
- Body:
interface CreatePetBody { name: string age: string breed: string }
- PATCH /pets/:id
- Change details a pet
- Body:
interface PetUpdateBody { name?: string age?: number user?: { id: number } }
- GET /owners
- Get all owners
- GET /owners/:id
- Get a single owner
- POST /owners/new
- Create a new owner
- Body:
interface CreateOwnerBody { name: string }
- PATCH /owners/:id
- Change details an owner
- Body:
interface UserUpdateBody { name?: string pets?: { id: number }[] }
- Language: Typescript/Javascript
- Backend Framework: Express
- Database: Postgres
- ORM: Typeorm
- Hosting: Heroku