I have the following segment of code in my server callback:
switch (request.url) {
case "/somescript" :
response.writeHead(200, {"Content-Type": "text/javascript"});
response.write(somescript);
break;
default :
response.writeHead(200, {"Content-Type": "text/plain; charset=UTF-8"});
response.write(html);
}
response.end();
When I run the server, when I enter this:
localhost:3000
on the browser, how can I have it change automatically to:
localhost:3000/changed
Only using Node.js (in my default section of the switch statement)?