https://github.com/bratelion/myfriends
Dockerized KoaJS backend and Postgres DB
https://github.com/bratelion/myfriends
backend koajs postgres
Last synced: 4 months ago
JSON representation
Dockerized KoaJS backend and Postgres DB
- Host: GitHub
- URL: https://github.com/bratelion/myfriends
- Owner: Bratelion
- Created: 2021-07-15T14:47:46.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T10:31:07.000Z (about 4 years ago)
- Last Synced: 2025-03-27T13:36:45.071Z (about 1 year ago)
- Topics: backend, koajs, postgres
- Language: TypeScript
- Homepage:
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Awesome Project Build with TypeORM
Steps to run this project:
1. Run `npm i` command
2. Run `docker-compose build` command
3. Run `docker-compose up` command
# Migration
1. Run `npm run migration:generate "NAME"` to generate new migration schema
2. Run `npm run migration:run` to run the migrations
Migrations are set to run prior to `npm start` inside Docker container, so your only job is entity changes and generation of migrations in CLI of app in docker
# Methods
Start sending requests to fill up the database:
## GET /friends
Get list of all friends
## GET /friends/:friend_id
Get details about friend with id = :friend_id
## POST /friends
Post a new friend into DB
body {
"first_name" : "STRING", // required
"last_name" : "STRING", // required
"nickname" : "STRING",
"rating" : "INTEGER"
}
## DELETE /friends/:friend_id
Delete friend with id = :friend_id