Work in Progress
Create a Slack slash command that will return a stock price. The implementation will be based on using Function as a Service with the help of the Serverless Framework. Language used is node.js.
Running server-side logic on a stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a 3rd party.
The Serverless Framework is an application framework for building web, mobile and IoT applications powered by AWS Lambda, AWS API Gateway and in the future other Function as a Service providers.
AWS Lambda is a compute service where you can upload your code to AWS Lambda and the service can run the code on your behalf using AWS infrastructure.
-
Make sure you have an AWS access key & secret with admin permissions.
-
Follow the Serverless Framework guide:
-
Add Slack slash command that will receive a stock ticker (e.g. ADSK) and will send a
GET
request to your FaaS endpoint, passing the ticker as a query param. Make sure to create a unique command name. -
Your function will: 5. Read the ticker argument 6. Call
http://www.google.com/finance/info?q=NASDAQ:ticker
and parse the response 7. Return the stock price to the slack command
For example:
TODO: screenshot
- Serverless Architectures (by Mike Roberts, Martin Fowler's blog)
- Serverless resources