Created
August 26, 2019 13:37
-
-
Save victorpaulo/13c544c87e8822a0369d55f2038ccaf4 to your computer and use it in GitHub Desktop.
Twilio WhatsApp Sandbox
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
'use strict'; | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
// Constants | |
const port = process.env.PORT || 8080; | |
// App | |
const app = express(); | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); | |
app.use(bodyParser.json()); | |
app.post('/', function (req, res) { | |
console.log("echo post"); | |
console.log(req.headers) | |
console.log(req.body) | |
}); | |
var server = app.listen(port, function () { | |
console.log('Server running at http://127.0.0.1:' + port + '/'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment