Window not defined? : <p>I am running a local server as shown and when I load it, it says "window not defined" what could be the problem here? I am waiting till it loads my index.html file and calling a callback to it.</p>

<pre><code>module.exports=function(){
 //require the express module to use it in the app
 var express=require('express');
 //create an express app, fire the express function
 //to be able to use the methods in express
 var app=express();
app.listen(3000);
app.get('/', function(req,res){
res.sendFile(__dirname+'/index.html',function(){
  window.onload=function(){
    alert('webpage loaded');

    }
  });
 });
}
</code></pre>
