Created
November 13, 2021 07:17
-
-
Save justinbiebur/82963a50ec5a55ae0a31ea093da00110 to your computer and use it in GitHub Desktop.
A very simple express server to log id provided as parameter in a get request.
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
// make sure to add express to package.json | |
var express = require('express'); | |
var app = express();; | |
var PORT = 3000; | |
app.get('/:id', function (req, res) { | |
console.log(req.params['id']); | |
res.send(); | |
}); | |
app.listen(PORT, function(err){ | |
if (err) console.log(err); | |
console.log("Server listening on PORT", PORT); | |
}); | |
// node simple-echo-server.js | |
// keep the server running while our app makes requests from the background. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment