This API consumes GitHub APis and return repositories results in reactive style
$ npm install
If launching in Development or Watch mode:
Copy the sample.env file to the same directory and rename it to .env
$ cd .\docker
$ docker-compose up
$ npm run start
$ npm run start:dev
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
The REST API endpoints can be found below
GET /user/:GitHubUsername/repositories
Query param | Default | Values |
---|---|---|
includeForks | false | true, false |
curl -i -H 'Accept: application/json' http://localhost:8080/user/rafavrech/repositories
HTTP/1.1 200 OK
Date: Sun, 08 Aug 2021 12:36:32 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: X
[
{
"name": "RepositoryName",
"owner": "GitHubUserName",
"branches": [
{
"name": "master",
"lastCommitSHA": "03993b7cfd8f35ba64c9a06eb29e789ac415d155"
}
]
}
]
HTTP/1.1 404 Not Found
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 77
Date: Mon, 09 Aug 2021 02:22:29 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"status":404,"message":"Failed to find repositories for user 'rafavresdch'"}
HTTP/1.1 406 Not Acceptable
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 74
ETag: W/"4a-Ftmm3wO09kfQ6hkEFAUIPYnYm98"
Date: Mon, 09 Aug 2021 02:27:42 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"status":406,"message":"Accept type 'application/test' is not supported"}
- Author - Rafael Vrech