diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..04f1687 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2017 Clear Function + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 762cbd5..323c179 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Bolt](https://api.slack.com/bolt). It allows users to play mp3 clips on a Sonos speaker. It communicates with [Sonos Proxy](https://github.com/clearfunction/sonos_proxy_nodejs) which then communicates with [node-sonos-http-api](https://github.com/jishi/node-sonos-http-api). -We affectionately refer this as "Burn Bot." +We affectionately refer to this as "Burn Bot." ## Architecture @@ -18,13 +18,20 @@ sequenceDiagram ## Requirements -* Yarn -* Node +- Yarn +- Node ## Running Locally The easiest way to test is to set this up in a standalone Slack instance and -then use ngrok. +then use a local proxy like [ngrok](https://ngrok.com/). + +- Create a Slack application (see Slack Bolt API link below) +- Run `yarn dev` (it defaults to port 3000) +- Run ngrok to create a proxy to your Bolt app (`ngrok serve 3000`) +- Point your Slack's event subscription to your ngrok URL +- Set up [Sonos Proxy](https://github.com/clearfunction/sonos_proxy_nodejs) +- Enjoy! ## Deployment @@ -32,7 +39,7 @@ See the `Makefile`... make sure you are in the expected subscription by running ## Resources -* [Slack Bolt API](https://slack.dev/bolt/) -* [Block Kit Builder](https://api.slack.com/tools/block-kit-builder) -* [Sonos Proxy](https://github.com/clearfunction/sonos_proxy_nodejs) -* [node-sonos-http-api](https://github.com/jishi/node-sonos-http-api) +- [Slack Bolt API](https://slack.dev/bolt/) +- [Block Kit Builder](https://api.slack.com/tools/block-kit-builder) +- [Sonos Proxy](https://github.com/clearfunction/sonos_proxy_nodejs) +- [node-sonos-http-api](https://github.com/jishi/node-sonos-http-api) diff --git a/src/app.ts b/src/app.ts index 2bb72be..f09b7ce 100644 --- a/src/app.ts +++ b/src/app.ts @@ -15,8 +15,9 @@ const app = new App({ attachResponses(app, sonos); (async () => { - const server = await app.start(Number(process.env.PORT) || 3000); + const port = Number(process.env.PORT) || 3000; + const server = await app.start(port); sonos.initialize(server, app); - console.log('⚡️ Bolt app is running!'); + console.log(`⚡️ Bolt app is running on ${port}!`); })();