Welcome to the NodeJS server that demonstrates how you can build a server that can be used to respond to server commands.
This project was born as a joke to my friend, Quentin Dallaserra, and I. We both love Slack and we love the /giphy
command. I noticed Slack's API allows you create your own slash commands, so to pay homage to my friend Quentin, I created this server in order to embarrass him by implementing a response to Slack's POST
request that is initiated when you type /quentin
.
To setup the server you will first need to install NodeJS.
NOTE: NodeJS must be >= v4.5, this is due to the fact that the code uses ECMAScript 6.
Next you will need to run:
npm install
Once the packages have been installed, you will notice a config file has been created: .env
. Open up this file and edit the following properties:
PRIVATE_NETWORK_IP=127.0.0.1
SLACK_TOKEN=s89qc_a_long_string_soxs8x
You will find your Slack token on the custom command settings page.
You are almost done, you can now simply run:
npm start
This will start running the nodemon server on localhost:1337 that will automatically reload on any code changes.
All tests are in the testing directory and they use Mocha, Chai and Sinon.
Testing can be run by simply using:
npm test
This will run mocha.