Created
September 30, 2015 02:54
-
-
Save Sparragus/e37e5f476a47dee97292 to your computer and use it in GitHub Desktop.
slack-hello-world/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
var request = require('request') | |
// Esta variable contiene el URL que Slack nos provee | |
var webhookURL = 'AQUI_PEGAS_LA_WEBHOOK_URL' | |
// Este es el mensaje que queremos enviar | |
var payload = { | |
text: 'Hello, World!' | |
} | |
// Aquí definimos las opciones para el request | |
var requestOptions = { | |
uri: webhookURL, | |
method: 'POST', | |
body: JSON.stringify(payload) | |
} | |
// Enviamos el request con nuestro mensaje | |
request(requestOptions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment