Using the simple example
var server = http.createServer(function(req, res){
var output = {message: "Hello World!"};
var body = JSON.stringify(output);
res.writeHead(200, {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
});
res.end(body);
});
I can return json object. How Can I return some parameters from request like this
url: http://localhost:8080/get/jhon
output: {"message": "Hello jhon"}
add a checker for the
request.urlbasically, using your own code as an example:
Hope that helps.