How do you get the get request string into a viable, like if someone goes to www.mypage.com/yo , how can I get node to return "yo" into a variable?
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
var stringrequested = ??????
response.end(stringrequested);
});
// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);
// Put a friendly message on the terminal
console.log("Server running");