0
var express = require("express") ,http =require("http"); var app = express(); app.configure(function(){ app.set("port", process.env.PORT || 3000); }); app.get("/", function(request,response){ var message = ["<h1>Hello guys</h1>"].join("\n"); response.send(message); }); app.get("/user/:userId", function(request,response){ response.send("<h1>Hello, user # " + response.params.userId + "."); }); 

Error:-

app.configure(function(){}); TypeError: app.configure is not a function

2

1 Answer 1

1

app.configure has been dropped from Express 4, see: https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x.

Instead you can do the configuration directly:

 app.set("port", process.env.PORT || 3000); app.listen(app.get('port')); 
Sign up to request clarification or add additional context in comments.

1 Comment

Okay. Let me try.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.