Questions tagged [connect.js]

Connect is a simple framework to glue together various "middleware" to handle requests.

11 questions
117
votes
1 answer

What does Connect.js methodOverride do?

The Connect.js very terse documentation says methodOverride Provides faux HTTP method support. What does that mean? The obvious Google search is less than helpful. Why is methodOverride useful?
Randomblue
  • 112,777
  • 145
  • 353
  • 547
66
votes
6 answers

How can I configure multiple sub domains in Express.js or Connect.js

I am used to working on httpd ( Apache ) which provides a way to configure subdomains which is mapped to a directory. How can I do the same thing in Connect.js/Express.js ? I see that the only thing that I have is routes which I am not sure how I…
Raks
  • 1,723
  • 3
  • 18
  • 26
8
votes
3 answers

Node.js middleware organization and parameter validation

I'm building an express app and I'd like to know how fancy I can get with middleware. Roughly, I want to accomplish the following with middleware. Done: Add requestId to all routes Authenticate request Check whether a user has access to a given…
nflacco
  • 4,972
  • 8
  • 45
  • 78
5
votes
1 answer

control order of express/connect middleware

I'm trying to add authentication middleware that should prevent access to part of the site: app = express() .get('/api/test', function (req, res) { ... }) .use('/api', function (req, res, next) { if (req.param('key')) { …
Alex Netkachov
  • 13,172
  • 6
  • 53
  • 85
3
votes
2 answers

ssh2 connect to multiple server and get the output nodejs

I am using ssh2 nodejs module to connect to a UNIX application and run a script and it is successful. Now i want to connect to multiple servers one by one and get the output and store it. When i try using a for loop to pass the servers one by one…
Sshastry
  • 57
  • 1
  • 8
3
votes
2 answers

Node.js / Connect Use Existing Connect.SID

I have a Chicken and Egg problem. I am using a Node.js HTTPServer to route web requests to different Node.js workers, depending on their Connect.SID cookie that is sent in the request headers. Each of my Node.js workers use Connect / Express and…
dthree
  • 19,847
  • 14
  • 77
  • 106
2
votes
1 answer

Get server's port from Node JS connect.js

I'd like to output a message like "Listening on port {port_#}" to the terminal from my node js server. I found documentation, such as this, NodeJS: How to get the server's port?, but they only talk about Express JS. I'm using the ConnectJS aspect…
user3871
  • 12,432
  • 33
  • 128
  • 268
1
vote
1 answer

How to modify the node js request timeout in core set up or node js default library?

In node js, Socket Timeout by default has been set for Two Minutes in the package itself which i found in the documentation. I want the location where this code is lying inside the package so that i can modify them. I found the following alternate…
0
votes
1 answer

Backbone.js 404 (Not Found) error when using .save() command

I'm fetching data using backbone.js with the following code. The .get and .set commands work fine, but if I set JSON data, then use .save(), I get a 404 (Not Found) error. var ExampleModel = Backbone.Model.extend({}); var example = new…
seal6105
  • 103
  • 1
  • 1
  • 5
0
votes
1 answer

How do you use Connect.js methods if you're running Express.js?

I'm using Node with Express. Express has Connect kinda buried within it. How do you call Connect's various methods though? When I require Express then doing express.middleware.someconnectmiddleware fails...
CommaToast
  • 11,370
  • 7
  • 54
  • 69
-1
votes
1 answer

Error: Can't set headers after they are sent. Connect.js

I'm new to Connect.js and I am trying to figure out how exactly it is working. I wrote a very simple function - reading a file and printing it. I am not sure why I am getting this error Error: Can't set headers after they are sent. Any help will be…
Neli Chakarova
  • 660
  • 1
  • 5
  • 18