Skip to content

Commit

Permalink
Complete readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse committed Nov 4, 2015
1 parent 5d92dc4 commit ccccba3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion .foreman

This file was deleted.

2 changes: 1 addition & 1 deletion Procfile
@@ -1 +1 @@
web: node app/index.js
web: node index.js
11 changes: 9 additions & 2 deletions README.md
@@ -1,4 +1,11 @@
# services-slack
# Slack Wbhook Service

Slack notifications service for GitBook.
This application is a simple webhook service for GitBook that post notifications to Slack.

#### How to use it?

1. Create an `incoming-webhook` integration in slack.
2. You'll get an url like `https://hooks.slack.com/services/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`
3. Create a webhook in your book with `https://slack-service.gitbook.com/hook/v1/T032H76MF/B0DR4R4US/SBdsOaiWfAfX57DNbgZ5wdIq`
4. Done!

1 change: 1 addition & 0 deletions app/index.js → index.js
Expand Up @@ -27,6 +27,7 @@ app.post('/hook/v1/:tokens([\\/.\\w]*|)', gitbookMiddleware, function (req, res,
slack.send({
text: '<'+build.author.urls.profile+'|'+build.author.name+'> published a new update of <'+book.urls.access+'|'+book.title+'>',
username: 'GitBook',
icon_url: 'https://www.gitbook.com/assets/images/logo/128.png'
})
.then(function() {
res.send({ ok: true });
Expand Down
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"express": "4.13.3",
"lodash": "3.10.1",
"q": "1.4.1",
"gitbook-webhook-middleware": "1.0.0",
"gitbook-webhook-middleware": "1.0.1",
"node-slack": "0.0.7"
},
"repository": {
Expand All @@ -19,5 +19,8 @@
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/GitbookIO/services-slack/issues"
},
"scripts": {
"start": "node ./index.js"
}
}

0 comments on commit ccccba3

Please sign in to comment.