<commit_before># github-trending-api
[![Build Status](https://travis-ci.org/yamadapc/github-trending-api.svg?branch=master)](https://travis-ci.org/yamadapc/github-trending-api)
[![Docker Image Size](https://img.shields.io/imagelayers/image-size/yamadapc/github-trending-api/latest.svg)](https://hub.docker.com/r/yamadapc/github-trending-api/)
[![Docker Image Pulls](https://img.shields.io/docker/pulls/yamadapc/github-trending-api.svg)](https://hub.docker.com/r/yamadapc/github-trending-api/)

- - -
This module is an API for the `github-trending` NPM module. So it can be ran as
an "ultra-micro-service". It has an in-memory cache for results; so _mostly_ you
can use it from another point of the application and not worry about anything
else.

It exposes a standalone `express` app, which can be ran from the command-line
with:
```
$ npm install github-trending-api
$ github-trending-api
```

And an `express.Router` instance, which is what `require('github-trending-api')`
returns.

_A write-up on its stack is pending._

## Endpoints
### `GET /repositories`
Responds with a list of trending repositories; accepts an optional `language`
QueryString parameter.

### `GET /languages`<commit_msg>Add note on docker images to the README<commit_after># github-trending-api
[![Build Status](https://travis-ci.org/yamadapc/github-trending-api.svg?branch=master)](https://travis-ci.org/yamadapc/github-trending-api)
[![Docker Image Size](https://img.shields.io/imagelayers/image-size/yamadapc/github-trending-api/latest.svg)](https://hub.docker.com/r/yamadapc/github-trending-api/)
[![Docker Image Pulls](https://img.shields.io/docker/pulls/yamadapc/github-trending-api.svg)](https://hub.docker.com/r/yamadapc/github-trending-api/)

- - -
This module is an API for the `github-trending` NPM module. So it can be ran as
an "ultra-micro-service". It has an in-memory cache for results; so _mostly_ you
can use it from another point of the application and not worry about anything
else.

It exposes a standalone `express` app, which can be ran from the command-line
with:
```
$ npm install github-trending-api
$ github-trending-api
```

And an `express.Router` instance, which is what `require('github-trending-api')`
returns.

_A write-up on its stack is pending._

## Docker
This repository has automated image builds on hub.docker.com. So you can also
run:
```
$ docker run -it -p 3000:3000 yamadapc/github-trending-api
```

## Endpoints
### `GET /repositories`
Responds with a list of trending repositories; accepts an optional `language`
QueryString parameter.

### `GET /languages`
{'fraction_non_alphanumeric': 0.13687475765800697, 'fraction_numerical': 0.0031019775106630476, 'mean_word_length': 4.670329670329671, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2783209', 'n_tokens_mistral': 941, 'n_tokens_neox': 885, 'n_words': 236}