I\'m trying to find out how to load and render a basic HTML file so I don\'t have to write code like:
response.write(\'...blahblahblah
...\
we can load the html document with connect frame work. I have placed my html document and the related images in the public folder of my project where the below code and node modules present.
//server.js
var http=require('http');
var connect=require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('public'))
.use(function(req, res){
res.end('hello world\n');
})
http.createServer(app).listen(3000);
I have tried the readFile() method of fs, but it fails to load the images, that's why i have used the connect framework.