A serverless Slack Slash Commands to integrate Google Knowledge Graph API using AWS Lambda and AWS API Gateway.
APACHE-2.0 License
A serverless Slack Slash Commands to integrate Google Knowledge Graph API using AWS Lambda and AWS API Gateway.
This project was built with Ryan Ray's repo slack-lambda-weather and his post.
config.json
based on config.sample.json
. This file is gitignored by default because this is where you would put any API key's, AWS settings, and other secret info that your lambda may need.config.json
.npm install
Lambda is based on EC2 and allows you to deploy and execute your code (Node.js, Java, Python) without having to provision servers.
Deploy and update your Lambda code:
npm start
New: v0.4.0
sns.sample.js
codeLambda responds to events, which can come from a variety of sources. By default Lambda isn't accessable from a URL, but API Gateway allows you to map a URL and an HTTP method to trigger your Lambda code. You can setup GET, POST, PUT, etc... and map the parameters/body into a JSON payload that Lambda understands.
application/x-www-form-urlencoded
and click checkmarkapplication/x-www-form-urlencoded
POST from Slack to Lambda's application/json
formathttps://YOUR_TEAN_DOMAIN.slack.com/apps/manage
Slash Commands
and add a new configuration/google
in the command name input, click Add Slash Command Integration button.config.json
(NOTE: you don't want to expose the token to the public!).Improvements are welcome! Just fork, push your changes to a new branch, and create a pull request!