BASE_URL: https://gratis-app.herokuapp.com
clone the repo
- run
yarn install
to install all dependencies - create a postgres database
- run
yarn migrate:up
to initialize the database - run
yarn make:seed
to seed the database - run
yarn dev
to start your server on port 3000
GET ${base_url}/api/v1/blog
GET ${base_url}/api/v1/blog
Request parameter | Type | Description |
---|---|---|
page |
number |
Required. specify the page you want |
limit |
number |
Required. specify the limit |
GET /api/v1/${id}
Parameter | Type | Description |
---|---|---|
id |
number |
Required. Id of blog to fetch |
POST ${base_url}/api/v1/blog
Request data | Type | Description |
---|---|---|
title |
string |
Required. the title of the blogpost |
post |
string |
Required. The post to be created |
PUT ${base_url}/api/v1/blog
Request data | Type | Description |
---|---|---|
id |
number |
Required. the id of the blogpost to be edited |
post |
string |
Required. the edited post |
DELETE ${base_url}/api/v1/blog
Request data | Type | Description |
---|---|---|
id |
number |
Required. the id of the blogpost to be deleted |
GET ${base_url}/api/v1/comment
GET ${base_url}/api/v1/comment/${id}
Parameter | Type | Description |
---|---|---|
id |
number |
Required. Id of blog to fetch |
POST ${base_url}/api/v1/comment
Request data | Type | Description |
---|---|---|
comment |
string |
Required. The comment |
blopostId |
number |
Required. The id of the blogpost to link the comment to |
PUT ${base_url}/api/v1/comment
Request data | Type | Description |
---|---|---|
id |
number |
Required. the id of the comment to be edited |
comment |
string |
Required. the edited comment |
DELETE ${base_url}/api/v1/comment
Request data | Type | Description |
---|---|---|
id |
number |
Required. the id of the comment to be deleted |
To run this project, you will need to add the following environment variables to your .env file
host=
port=
user=
password=
database=
- NodeJS
- Express
- Postgres
- Knex
- Joi