This is a very basic nodejs app which contains wrapper for github gist apis.
This app uses :
- NodeJS + Express
- Axios
- dotenv
- KnexJS
- SQLITE
All of them can be installed via running npm install post cloning.
Install gistapi with npm after cloning.
Step 1 : Clone the repo.
Step 2 : npm install
cd gistapi
npm install
Next , run the knex migrations so that our sqlite db is ready to use :)
./node_modules/knex/bin/cli.js migrate:up
Note : If you are not comfortable with sqlite and want any other database, just make changes in knexfile.js. Documentation here : http://knexjs.org/
The app will now be running on localhost:3000
GET /v1/user/${username}
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username for fetching gists |
GET /v1/gists/${gistId}
Parameter | Type | Description |
---|---|---|
gistId |
string |
Required. Id of gist to fetch |
GET /v1/gists/${gistId}/star
Parameter | Type | Description |
---|---|---|
gistId |
string |
Required. Id of gist to mark as starred |
GET /v1/gists/${gistId}/unstar
Parameter | Type | Description |
---|---|---|
gistId |
string |
Required. Id of gist to remove from starred list |
GET /v1/gists/