Skip to content

Commit

Permalink
Add Glitch to README
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinr committed Jun 14, 2017
1 parent c3e37b5 commit 9ea0bd2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ The user can accept the Terms of Service using message buttons. If a user has be
1. Navigate to the Install App page and install the app
1. Copy the `xoxb-` token after the installation process is complete

#### Clone and run this repo
1. Clone this repo and run `npm install`
#### Run locally or [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/remix/slack-terms-of-service-blueprint)
1. Get the code
* Either clone this repo and run `npm install`
* Or visit https://glitch.com/edit/#!/remix/slack-terms-of-service-blueprint
1. Set the following environment variables to `.env` (see `.env.sample`):
* `SLACK_TOKEN`: Your app's `xoxb-` token (available on the Install App page)
* `SLACK_VERIFICATION_TOKEN`: Your app's Verification Token (available on the Basic Information page)
* `PORT`: The port that you want to run the web server on
1. Start the app (`npm start`)
1. In another windown, start ngrok on the same port as your webserver (`ngrok http $PORT`)
1. If you're running the app locally:
1. Start the app (`npm start`)
1. In another windown, start ngrok on the same port as your webserver (`ngrok http $PORT`)

#### Enable the Events API
1. Go back to the app settings and click on Events Subscriptions
1. Set the Request URL to your ngrok URL + /events
1. Set the Request URL to your ngrok or Glitch URL + /events
1. On the same page, subscribe to the `team_join` team events

#### Enable Interactive Messages

1. In the app settings, click on Interactive Messages
1. Set the Request URL to your ngrok URL + /interactive-message
1. Set the Request URL to your ngrok or Glitch URL + /interactive-message
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

app.get('/', (req, res) => {
res.send('<h2>The Welcome/Terms of Service app is running</h2> <p>Follow the' +
' instructions in the README to configure the Slack App and your' +
' environment variables.</p>');
});

/*
* Endpoint to receive events from Slack's Events API.
* Handles:
Expand Down

0 comments on commit 9ea0bd2

Please sign in to comment.