Ryan Schmidt
unread,Aug 23, 2014, 12:19:44 PM8/23/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nod...@googlegroups.com
Your app.js file contains mostly extraneous unused code related to the express framework. And then you completely ignore that and create your own server; the following appears to be the only code you're actually using:
var http = require('http'); //add the http module
var myServer = http.createServer(function(res, res) {
// res.writeHead(200, {"Content-Type" : "text/html"});
// res.write("<b>Hello</b> World");
// res.sendFile(html/tenants.html);
res.sendfile(__dirname + '/html/tenants.html');
res.end();
}); //create a server
myServer.listen(3000);
One problem I see is that the signature of the function you're passing to http.createServer is wrong: you've specified the argument name "res" twice. The first parameter should be "req" (for "request"), and the second parameter should be "res" (for "response"):
var myServer = http.createServer(function(req, res) {