slack bot that provides subscription service for npm webhooks
Перейти к файлу
ashley williams 90cdef34cb Merge pull request #18 from npm/web-interface
add server and express app
2016-07-05 16:09:35 -04:00
assets switch image to haggis-pirate 2016-05-26 16:32:13 -07:00
migrations Change user information in db 2016-06-07 13:10:50 -07:00
seeds fix(login): change schema to reflect our actual attributes 2016-06-21 18:28:52 -07:00
src Merge pull request #18 from npm/web-interface 2016-07-05 16:09:35 -04:00
.envsample add backend and hooks 2016-05-26 08:34:34 -04:00
.gitignore add envsample and loading dep 2016-05-19 11:34:23 -04:00
LICENSE Initial commit 2016-05-19 11:05:57 -04:00
README.md update readme 2016-06-04 15:50:23 -04:00
index.js rename the create route to slack because that makes more sense 2016-05-26 18:22:16 -04:00
knexfile.js load .env in knexfile and /lib/database.js 2016-05-26 15:13:16 -04:00
package.json fixes #17 2016-06-01 09:34:54 -07:00
server.js add server and express app 2016-06-04 15:16:37 -04:00

README.md

captain-hook

a slack bot to subscribe to npm webhook notifications

captain hook

usage

/captain-hook subscribe <type: package||organization> <name> <sharedsecret>

local dev

captain-hook is a NodeJS application. if you don't have NodeJS you'll need to download it.

captain-hook uses a Postgres database.

up and running

  1. Fork and clone this repo
  2. cd captain-hook
  3. npm install
  4. Copy .envsample to .env and fill it out
variable description
SLACK_API_TOKEN Bot API token. You can find this on the Slack Developers site by navigating: Browse Apps > Custom Integrations > Bots Configurations on {{team_name}} > Edit configuration
SLACK_CHANNEL_ID Name of the channel, i.e. #testing. Can also be ID number retrieved from the Slack API.
SHARED_SECRET Any string.
DATABASE_URL URL of your Postgres database. defaults to localhost:5432/dev
  1. npm db:setup, creates a Postgres db, then runs Knex migrations and seeds
  2. npm run dev, runs npm start and pipes output to nice logging You now have a service running on localhost:6666. You'll probably want to expose that to the internet for local development. ngrok is a great, free option.

web interface

the captain hook web interface is an express app. it servers basic CRUD functionality for the two resources: users and subscriptions.

to start it, run npm run start:web and then visit http://localhost:8080.