Created
November 14, 2017 04:13
-
-
Save RobertVFrazier/91ef8a53f4ba5aa71436e719bdba6c4a to your computer and use it in GitHub Desktop.
Echo endpoint exercise - Wade & Robert
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.get('/echo/:what', function(req, res){ | |
res.json({ | |
host: req.hostname, | |
query: req.query, | |
params: req.params | |
}); | |
}); | |
app.listen(process.env.PORT, () => { | |
console.log(`Listening on port ${process.env.PORT}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment