Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bratelion/myfriends
Dockerized KoaJS backend and Postgres DB
https://github.com/bratelion/myfriends
backend koajs postgres
Last synced: about 2 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T10:31:07.000Z (almost 3 years ago)
- Last Synced: 2024-12-06T08:04:51.883Z (about 2 months 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 migrationsMigrations 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