Skip to content

Instantly share code, notes, and snippets.

@lucasscariot
Last active March 12, 2017 22:09
Show Gist options
  • Save lucasscariot/b2600b49f97f10623478662af86b02cc to your computer and use it in GitHub Desktop.
Save lucasscariot/b2600b49f97f10623478662af86b02cc to your computer and use it in GitHub Desktop.
Slack Command Server
const express = require('express')
const bodyParser = require('body-parser')
let app = express()
app.use(cors())
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.post('/', (req, res) => {
console.log(req.body);
res.json({
'text': `Want to eat ${req.body.text} ?`,
"attachments": [{
"text": "Yummy !"
}]
})
})
app.listen(3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment