LoginSignup
2
3

More than 5 years have passed since last update.

楽天ID決済とSlackの差異をつなぐだけのスニペット

Posted at

Expressのルータコード

楽天から出てくるwebhookにtextをつけるだけの簡単な操作。


router.all('/rakuten/', function(req,res,next){
  console.log(req.body);

  var payload = {};
  payload.text='てすと';

  request({
    uri: "https://hooks.slack.com/services/AAAAAAA/BBBBBBB/CCCCCCC",
    method: "POST",
    form: {
      payload: JSON.stringify(payload)
    },
    json: true

  }, function(error, response, body) {
    //console.log(body);
  });

  res.json(slackData);
});
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3