Как выполнить javascript на сервере node.js

Я написал сервер node.js.
Я могу извлечь переменную HTTP POST и GET из запроса.
Я хотел бы передать эту переменную в сценарий js на сервере, который будет выполнен.
В PHP для выполнения скрипта я бы просто указал на него @ www.example.com/path/file.php?variable=value

<?php echo "You have ".$_GET['variable'];?> 

Я хочу достичь того же с noge.js @ www.example.com/path/file.njs?variable=value
Моя проблема в файле file.njs выполняется как текст. Я не использую выражение, решение без него было бы оценено.

  var sys=require("sys"), http=require("http"), path=require("path"), url=require("url"), filesys=require("fs"), mime=require("./node_modules/mime"), head=require("./node_modules/headers/initreq.njs");//this is used to extract the header http.createServer(handler).listen(80);//handler function is below sys.puts("Node Server Running on 80"); function handler(request,response){ var myPath=url.parse(request.url).pathname;//get the url var ext=myPath.replace(/(.)*\./,'');//get the extension var fullPath=path.join(process.cwd(),myPath);//get the working dir & join it with current working dir var mimeResult=mime.lookup(fullPath),acceptExt=['html','njs']; if(acceptExt.indexOf(ext)!=-1){//only search HTTP header for html|njs files head.init(request,response,setContent);//head will correctly contain the $_GET AND $_POST variable } else {setContent();} function setContent(){ path.exists(fullPath,function(exists){ if(!exists){ response.writeHeader(404, {"Content-Type":"text/plain"}); response.write("404 Not Found:: "+fullPath+"\n"); response.end(); }else{ filesys.readFile(fullPath,"binary",function(err,file){ if(err){ response.writeHeader(500,{"Content-Type":"text/plain"}); response.write(err+"::"+myPath+"\n"); response.end(); }else{ response.setHeader("Content-Type", mimeResult); response.writeHeader(200); response.write(file,"binary");//this is the file that i want to execute and pass the $_POST & $_GET variable response.end(); } }); } }); } sys.puts("Requested:: "+myPath.replace(/(.)*\//,'')+" - "+mimeResult ); }