html - node.js code to open a page in browser with localhost URL -


i have written simple server using node.js. @ moment server responds writing "hello world" browser.

the server.js file looks this:

var http = require("http"); http.createserver(function(request, response) {   response.writehead(200, {"content-type": "text/plain"});   response.write("hello world");   response.end(); }).listen(8080); 

i use url in browser trigger "hello world" response:

http://localhost:8080/ 

i want able open basic html page when pass url this:

http://localhost:8080/test.html 

i have looked through many tutorials , stackoverflow posts there not out there on specific task. know how achieve simple modification server.js file?

if wish open .html file through nodejs of "http://localhost:8080/test.html" such url, need convert .html page .jade format.use rendering engine of expressjs framework.express rendering engine render .jade file on nodejs server.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -