A micro-service that provides Github related information to NodeZoo
npm install nodezoo-github![Nodezoo][Logo]
- __Lead:__ [Dean McDonnell][Lead]
- __Sponsor:__ [nearForm][Sponsor]
A micro-service that provides Github related information to [NodeZoo][]. This
micro-service requires a valid Github token to function, please see the Config
section below for details on how to obtain.
If you're using this micro-service, and need help, you can:
- Post a [github issue][],
- Tweet to [@nodezoo][],
- Ask on the [Gitter][gitter-url].
- [Nodezoo: The complete system][System]
To run in isolated mode,
- Clone this repository locally,
- Run npm install,
- Run GITHUB_TOKEN=YOUR_TOKEN npm start isolated,
__Note:__ You will need to have a valid github token to use isolated mode.
A simple http service is supported and can be called using Curl or other Rest client.
The default port is 8052. It can be changed using the GITHUB_PORT environment
variable.
```
curl -d '{"role":"github","cmd":"get","name":"hapi"}' http://localhost:8052/act
- On github.com, click your profile photo, then click settings.
- In the user settings sidebar, click Personal access tokens.
- Click Generate new token
- Give your token a descriptive name.
- Select the scopes you wish to grant, select all read-only scopes
- Click 'Generate token'.
- Copy the token to your clipboard and keep safe.
#### GITHUB_TOKEN
- The token to use when calling the GitHub api.
- Defaults to NO_TOKEN,
#### GITHUB_HOST
- The host to listen on in isolated mode.
- Defaults to localhost
#### GITHUB_PORT
- The port to listen on in isolated mode.
- Defaults to 8052 .
#### GITHUB_ISOLATED
- Starts isolated mode.
- Defaults to false.
#### GITHUB_REGISTRY
- Change the registry used to validate the module name.
- Defaults to http://registry.npmjs.org/.
## Sample Data
`json`
{
"entity$": "-\/-\/github_cache",
"name": "fuge",
"user": "apparatus",
"repo": "fuge",
"stars": 155,
"watches": 15,
"forks": 18,
"last": "2016-04-09T21:57:45Z",
"urlRepo": "https:\/\/github.com\/apparatus\/fuge",
"urlClone": "git+https:\/\/github.com\/apparatus\/fuge.git",
"urlSsh": "git@github.com:apparatus\/fuge.git",
"pullRequests": 1,
"cached": 1461229347738
}
Messages Handled
This micro-service handles the following messages.
`js`
seneca.act('role:github,cmd:get', {name: 'seneca'}, (err, data) => {})
but instead of returning data directly a
message is emitted using the pattern role:info,res:part. Allows integration with
the wider nodezoo system.`js
seneca.act('role:info, req:part', {name: 'seneca'}, (err, data) => {})
`Messages Emitted
This micro-service emits the following messages$3
Contains the response of an earlier call to role:info,req:part.`js
seneca.add('role:info,res:part', (msg, done) => {})
``- __[Code of Conduct]__
If you feel you can help in any way, be it with documentation, examples, extra testing, or new
features please get in touch.
[main repo]: https://github.com/rjrodger/nodezoo
[MIT]: ./LICENSE
[Code of Conduct]: https://github.com/nodezoo/nodezoo-org/blob/master/CoC.md
[Sponsor]: http://www.nearform.com/
[NodeZoo org]: http://www.nodezoo.com/
[NodeZoo]: https://github.com/nodezoo
[Lead]: https://github.com/mcdonnelldean
[github issue]: https://github.com/nodezoo/nodezoo-github/issues
[@nodezoo]: http://twitter.com/nodezoo
[gitter-url]: https://gitter.im/nodezoo/nodezoo-org
[System]: https://github.com/nodezoo/nodezoo-system
[Logo]: https://raw.githubusercontent.com/nodezoo/nodezoo-org/master/assets/logo-nodezoo.png