Since you’ve mentioned Express.js in your tags, here is an Express-specific answer: use req.query. E.g.
var express = require('express');
var app = express();
app.get("https://stackoverflow.com/", function(req, res){
res.send('id: ' + req.query.id);
});
app.listen(3000);