Skip to content

Instantly share code, notes, and snippets.

@justinbiebur
Created November 13, 2021 07:17
Show Gist options
  • Save justinbiebur/82963a50ec5a55ae0a31ea093da00110 to your computer and use it in GitHub Desktop.
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.
// 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