Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        


Nest Logo

[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.



NPM Version
Package License
NPM Downloads
Travis
Linux
Coverage
Gitter
Backers on Open Collective
Sponsors on Open Collective



## 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).