This repo uses SlackStocks - a slack slash command that gives you pricing information on a stock ticker, together with Chalice - a Python Serverless Microframework for AWS.
Unlike Zappa, Chalice doesn't use WSGI to serve the requests.
Currently there's no simple way to initialize an existing chalice project, so follow the next steps:
Set up you AWS credentials
Create virtual env
mkvirtualenv my-chalice
Install Chalice
pip install chalice
Create a new chalice project
chalice new-project chalice-slack-stock
cd chalice-slack-stock
Overwrite app.py
and requirements.txt
with those of this repository
Install requirements
pip install -r requirements.txt
Deploy
chalice deploy
In your slack team settings, add a Slash Command Configuration
Make sure your settings are like so:
- Add the command name "/stock"
- Add in the URL like so "http:///stock
- Essentially, in slack when you type in "/stock xyz", it will automatically call the above url as http://yourappurl/stock?text=xyz
- Set the Method type to GET
- If you've configured it correctly then you should be good to go! I've added a setup screenshot below as well