Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ricardoferreirasilva/github-consumer-example
A simple API that consumes the Github API.
https://github.com/ricardoferreirasilva/github-consumer-example
github nestjs
Last synced: 24 days ago
JSON representation
A simple API that consumes the Github API.
- Host: GitHub
- URL: https://github.com/ricardoferreirasilva/github-consumer-example
- Owner: ricardoferreirasilva
- License: mit
- Created: 2020-02-01T14:44:19.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:17:12.000Z (almost 2 years ago)
- Last Synced: 2023-03-07T08:21:30.824Z (almost 2 years ago)
- Topics: github, nestjs
- Language: TypeScript
- Homepage:
- Size: 1.59 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
[travis-url]: https://travis-ci.org/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
## Description
A simple NestJS application that uses the Github API to list user repositories.## Environment Variables
While it is possible to use the endpoint without setting up the Github access token, it is advisable to use a github OAuth token if you find yourself being rate-limited by the Github API, which only allows a certain ammount of non-authenticated requests per IP.
1. TOKEN = (github OAuth token)
You can load environment variables by creating a .env file at the root of the project.
## Installation
```bash
$ npm install
```## Running the app
```bash
# development
$ npm run start# watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```The request endpoint can be found in http://localhost:3000/github/repositories .
It is a GET request and it expects to receive a username param and the Accept header properly set up to application/json.
You can find a curl example bellow.```curl
curl -X GET \
'http://localhost:3000/github/repositories?username=ricardoferreirasilva' \
-H 'accept: application/json' \
-H 'cache-control: no-cache' \
-H 'postman-token: 3b64c5d0-f52d-41b6-ba12-213c356bc294' \
```## Test
```bash
# unit tests
$ npm run test# test coverage
$ npm run test:cov# test end to end
$ npm run test:e2e
```## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
## Stay in touch
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)## License
Nest is [MIT licensed](LICENSE).