bennybauer / serverless-workshop

Workshop for learning the Serverless Framework - WIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverless Workshop

Work in Progress

Goal

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.

Background

Function as a Service

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.

Read more here

Serverless Framework

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.

Read more here.

AWS Lambda

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.

Read more here.

Let's do it!

  1. Make sure you have an AWS access key & secret with admin permissions.

  2. Follow the Serverless Framework guide:

    1. Installation
    2. Setting an AWS profile
    3. Creating a service
    4. Creating a http endpoint for function
    5. Deploying a service
    6. Invoking a function
  3. 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.

  4. 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

Good Reads

About

Workshop for learning the Serverless Framework - WIP