I have a server.js like this:
var express = require('express');
var app=express();
app.get('/',function(req,res){
res.send(index.html); //this is stupid
});
app.listen(3000);
i have the index file in the same directory as that of server.js
Please guide.
Did you look at their docs at all? There's mention of static file serving in the FAQ, for example: http://expressjs.com/faq.html
Write this:
app.use(express.static(__dirname + '/public'));
Put all public static files in /public folder