Skip to content

Instantly share code, notes, and snippets.

@getnamo
Created July 13, 2019 20:57
Show Gist options
  • Save getnamo/ced1e6fbee122b640169f5fb867ed540 to your computer and use it in GitHub Desktop.
Save getnamo/ced1e6fbee122b640169f5fb867ed540 to your computer and use it in GitHub Desktop.
const express = require('express')
const app = express()
app.use(express.json())
app.post(
'/',
(req, res) => {
console.log(req.body);
let resObj = { replyType:"echo", content: req.body};
res.end(JSON.stringify(resObj));
}
)
const PORT = process.env.PORT || 3000
app.listen(PORT, () => {
console.log(`Server listening on port ${PORT}`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment