I am trying to export Connect
as an middleware for an HTTP server test, but when I execute the code, it says the follow :
connect.createServer is not a function
My code :
hello_world.js
function helloWorld(req, res) {
res.end('Hello World!');
}
module.exports = helloWorld;
hello_world_app (where the problem is) :
var connect = require('connect');
// import middlewares
var helloWorld = require('./hello_world');
var app = connect.createServer(helloWorld);
app.listen(8080);
He points out to the hello_world_app
in the var app
, saying that is not a function. How can I make this work ?
via Monteiro
No comments:
Post a Comment