Created
July 13, 2019 20:57
-
-
Save getnamo/ced1e6fbee122b640169f5fb867ed540 to your computer and use it in GitHub Desktop.
This file contains 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
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