Skip to content

Commit 3e590da

Browse files
committed
Merge pull request #54 from nodezoo/vnext
6.1.0
2 parents a51c2a9 + aab558c commit 3e590da

7 files changed

Lines changed: 266 additions & 216 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
7 April 2016 - 6.1.0
2+
---
3+
* Added CHANGELOG.md
4+
* Removed redundant data folder.
5+
* Removed unneeded build.sh.
6+
* Moved logic script into lib.
7+
* Refactored start.js and github.js for clarity.
8+
* Removed unneeded seneca actions
9+
* Added isolation mode
10+
* Updated docs to reflect changes
11+
12+
6 April 2016 - 6.0.0
13+
---
14+
* First release of the 6th major revision of nodezoo.

README.md

Lines changed: 92 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,116 @@
1-
![Nodezoo](https://raw.githubusercontent.com/nodezoo/nodezoo-org/master/assets/logo-nodezoo.png)
1+
![Nodezoo][Logo]
22

3-
## nodezoo-github
3+
# nodezoo-github
44

5-
- __Lead:__ [Richard Rodger][Lead]
6-
- __Sponsor:__ [nearForm][]
5+
- __Lead:__ [Dean McDonnell][Lead]
6+
- __Sponsor:__ [nearForm][Sponsor]
77

8-
Nodezoo.com micro-service handling github meta data. Please see the [main repo][] for more details
8+
A micro-service that provides Github related information to [NodeZoo][]. This
9+
micro-service requires a valid Github token to function, please see the Config
10+
section below for details on how to obtain.
911

10-
If you're using this microservice, and need help, you can:
12+
If you're using this micro-service, and need help, you can:
1113

1214
- Post a [github issue][],
1315
- Tweet to [@nodezoo][],
1416
- Ask on the [Gitter][gitter-url].
1517

1618
## Running
17-
This micro-service can be ran as part of the [NodeZoo org][] system. Please follow the
18-
link below for details on obtaining and running the complete system.
19+
This micro-service can be ran as part of a complete system or as a single isolated
20+
unit.
21+
22+
### As a complete system
23+
A special system repository is available that runs the complete system using Docker
24+
and Fuge.
1925

2026
- [Nodezoo: The complete system][System]
2127

28+
### Isolated mode
29+
To make testing easier this micro-service can be ran in 'isolated' mode. This mode
30+
allows testing over http using a well defined port. Please note isolated mode means
31+
patterns are not exposed via mesh.
32+
33+
To run in isolated mode,
34+
35+
- Clone this repository locally,
36+
- Run `npm install`,
37+
- Run `GITHUB_TOKEN=YOUR_TOKEN npm start isolated`,
38+
39+
__Note:__ You will need to have a valid github token to use isolated mode.
40+
41+
A simple http service is supported and can be called using Curl or other Rest client.
42+
The default port is `8052`. It can be changed using the `GITHUB_PORT` environment
43+
variable.
44+
45+
```
46+
curl -d '{"role":"github","cmd":"get","name":"hapi"}' http://localhost:8052/act
47+
```
48+
2249
## Configuration
23-
Set the `$GITHUB_TOKEN` environment variable with a GitHub Access Token.
2450

25-
## Creating a GitHub Personal Access Token
51+
### Creating a GitHub Personal Access Token
52+
You will need a token for this service if regardless of how you choose to run it.
2653

27-
- In the top right corner of any page, click your profile photo, then click Settings.
54+
- On github.com, click your profile photo, then click settings.
2855
- In the user settings sidebar, click Personal access tokens.
2956
- Click Generate new token
3057
- Give your token a descriptive name.
31-
- Select the scopes you wish to grant to this token. The default scopes allow you to interact with public and private repositories, user data, and gists
32-
- Click Generate token.
33-
- Copy the token to your clipboard. For security reasons, after you navigate off this page, no one will be able to see the token again.
58+
- Select the scopes you wish to grant, select all read-only scopes
59+
- Click 'Generate token'.
60+
- Copy the token to your clipboard and keep safe.
61+
62+
### Environment Variables
63+
Various settings can be changed using environment variables, see the list below for
64+
all available variable names.
65+
66+
#### GITHUB_TOKEN
67+
- The token to use when calling the GitHub api.
68+
- Defaults to `NO_TOKEN`,
69+
70+
#### GITHUB_HOST
71+
- The host to listen on in isolated mode.
72+
- Defaults to `localhost`
73+
74+
#### GITHUB_PORT
75+
- The port to listen on in isolated mode.
76+
- Defaults to `8052` .
77+
78+
#### GITHUB_ISOLATED
79+
- Starts isolated mode.
80+
- Defaults to `false`.
81+
82+
#### GITHUB_REGISTRY
83+
- Change the registry used to validate the module name.
84+
- Defaults to `http://registry.npmjs.org/`.
85+
86+
## Messages Handled
87+
This micro-service handles the following messages.
3488

35-
## Patterns Handled
3689
### `role:github,cmd:get`
37-
Request module details by name
90+
Request a module's Github details. The name supplied must be a valid module on npm.
91+
92+
```js
93+
seneca.act('role:github,cmd:get', {name: 'seneca'}, (err, data) => {})
94+
```
95+
96+
### `role:info,req:part`
97+
Acts as an alias for `role:github,cmd:get` but instead of returning data directly a
98+
message is emitted using the pattern `role:info,res:part`. Allows integration with
99+
the wider nodezoo system.
100+
38101
```js
39-
seneca.act('role:github, cmd:get', {name: 'seneca'})
102+
seneca.act('role:info, req:part', {name: 'seneca'}, (err, data) => {})
40103
```
41104

42-
## Patterns Emitted
105+
## Messages Emitted
106+
This micro-service emits the following messages
43107

44-
There are no outgoing messages.
108+
### `role:info,res:part`
109+
Contains the response of an earlier call to `role:info,req:part`.
110+
111+
```js
112+
seneca.add('role:info,res:part', (msg, done) => {})
113+
```
45114

46115
## Contributing
47116
The [NodeZoo org][] encourages __open__ and __safe__ participation.
@@ -58,10 +127,12 @@ Licensed under [MIT][].
58127
[main repo]: https://github.com/rjrodger/nodezoo
59128
[MIT]: ./LICENSE
60129
[Code of Conduct]: https://github.com/nodezoo/nodezoo-org/blob/master/CoC.md
61-
[nearForm]: http://www.nearform.com/
130+
[Sponsor]: http://www.nearform.com/
62131
[NodeZoo org]: http://www.nodezoo.com/
63-
[Lead]: https://github.com/rjrodger
132+
[NodeZoo]: https://github.com/nodezoo
133+
[Lead]: https://github.com/mcdonnelldean
64134
[github issue]: https://github.com/nodezoo/nodezoo-github/issues
65135
[@nodezoo]: http://twitter.com/nodezoo
66136
[gitter-url]: https://gitter.im/nodezoo/nodezoo-org
67137
[System]: https://github.com/nodezoo/nodezoo-system
138+
[Logo]: https://raw.githubusercontent.com/nodezoo/nodezoo-org/master/assets/logo-nodezoo.png

build.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

github.js

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)