Majordomo allows you to easily integrate your project with slack, github, (eventually) email, and (potentially) more.
Majordomo does this by allowing you to create handlers, which are bits of code that run when Majordomo receives certain events, including HTTP Post Requests and Slack Messages. Inside your handlers, you can use one liners to send slack messages, create github issues, and more!
-
Think about some action you want to automate.
For example, say you wanted an endpoint to forward whatever is sent to it to slack. Consider the handler we would write in this situtation:
fn handle(v) { slack_post("majordomo-testing-channel", v); v }
-
Obtain an API Key (for now talk to @khemritolya )
-
Create your handler by POST-ing to the endpoint
curl -X POST https://[addr]/upsert_handler -d "{\"uri\":\"example\", \"code\":\"fn handle(v) { slack_post("majordomo-testing-channel", v); v } \", \"api_key\":\"[your api key]\"}"
-
Make calls to the handler in your project!
curl -X POST https://[addr]/h/example -d "Hello World"
This now posts "Hello World" to "#majordomo-testing-channel" on slack. It will also respond with the json
{"status":true,"data":"Hello World"}
. If there had been any errors along the way, the status becomes false, and data contains a helpful error message!