1var express = require('express');
2var app = express();
3
4app.get('/', function(req, res){
5 res.send('id: ' + req.query.id);
6});
7
8app.listen(3000);
1const http = require('http');
2const url = require('url');
3
4http.createServer(function (req, res) {
5 const queryObject = url.parse(req.url,true).query;
6 console.log(queryObject);
7
8 res.writeHead(200, {'Content-Type': 'text/html'});
9 res.end('Feel free to add query parameters to the end of the url');
10}).listen(8080);