i have installed node.js and i have my directory named nodeapps in c:/nodeapps. i am trying to create a static page server but when i call the file in command prompt it shows an error ! i am new to node.js so i copy this for creating the page from a book that is may not for the latest version that i am using.i am using windows 7 .if thats not the code then what is the function ? can anyone help me !
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\HP>cd c:/
c:\>cd nodeapps
c:\nodeapps>node server.js
c:\nodeapps\server.js:4
connect.static(__dirname)
^
TypeError: connect.static is not a function
at Object.<anonymous> (c:\nodeapps\server.js:4:15)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)
at node.js:933:3
c:\nodeapps>
and this the code in the server.js
var connect = require('connect');
var port = 3000;
connect.createServer(
connect.static(__dirname)
).listen(port);
console.log('connected via port '+port);