Connect is a middleware framework for Node.js. It processes or decorates HTTP requests and responses to provide features such as session handling, authentication, asset management or compression.
Questions tagged [node.js-connect]
298 questions
0
votes
2 answers
Closing a connect server
I see plenty of examples of how to create a server with Connect, but how do I close it gracefully without ctrl + c?
My use case is to spin up a lightweight connect server for testing/mocking purposes.

badunk
- 4,310
- 5
- 27
- 47
0
votes
1 answer
Req.data not showing up once sent to server with POST method (using connect middleware)
I'm unable to get the var data I sent in via a POST method. This should be easy (right?), but I'm clearly missing something (either conceptually or a setting).
At this stage, I simply want to check to see if the server side code will output the…

cathy.sasaki
- 3,995
- 6
- 28
- 39
0
votes
1 answer
Error loading webpage while parsing JSON-string
Please have a look at my code where I'm trying to compress data using connect.compress middleware. How can I parse the JSON string in browser to get the decompressed data? When I try to hit localhost:2080 I'm getting a page loading error.
Client…

user87267867
- 1,409
- 3
- 18
- 25
0
votes
1 answer
Cannot find module 'connect' on Mac OS X Lion
I installed the Connect module using NPM running the following command:
npm install connect
It created the module in the /Download/usr/node_modules/connect folder. I created a file which uses the Connect module using:
var connect =…

Harish
- 1,469
- 16
- 43
0
votes
1 answer
Node JS Connect file server not serving as expected
I'm playing with a simple Connect file server:
var connect = require('connect'),
http = require('http');
connect()
.use(connect.static('.'))
.listen(3000);
The file index.html loads when I visit localhost:3000. But I can't seem to…

guypursey
- 3,114
- 3
- 24
- 42
0
votes
3 answers
Trouble Setting up Stylus Middleware w/ Node and Connect
I'm attempting to set up the Stylus Middleware, and I'm having no success. The documentation is not good for beginners or those new to Node.js. What I surmised was that I need to create a little mini Node app that will use the stylus middleware.…

fraxture
- 5,113
- 4
- 43
- 83
0
votes
2 answers
Express middleware to inject content into
I'd like to create some Express middleware that injects content into the part of every HTML document returned by the server. Is this possible or advisable?
Thanks!

Bill C
- 125
- 6
0
votes
3 answers
Access req and res inside of app.locals
Trying to write some helper methods for an express 3.0 app. Here is an example to greet the user:
app.locals.greet = function(req,res) {
return "hey there " + req.user.name;
}
However, req and res aren't available inside that function. How…

wesbos
- 25,839
- 30
- 106
- 143
0
votes
1 answer
Node.js connect.bodyParser throws 400 on GET request
I have written a node.js proxy server ( its here on github )
The problem is that the connect.bodyParser doesn't work very well.
For this probject I've written my own bodyParser (see the file 'server'), but now I was testing again with…

Jeanluca Scaljeri
- 26,343
- 56
- 205
- 333
0
votes
2 answers
connect.router error and how to re-write it in node
I'm reading "Beginning Mobile Application Development in the Cloud" by Richard Rodger and some sample codes use Connect which, I have found, no longer allows direct request processing to the router layer. Here is a sample that gives a 'has no method…

Zoe Marmara
- 1,142
- 1
- 10
- 15
0
votes
1 answer
How to auto bind collection from HTML form using node.js express framework?
I am looking for a way to bind a collection on the server side, for example:
single binding
binds to
person:{
name: 'Name from html form'
}
If I am using express I can have access to this object…

Renato Gama
- 16,431
- 12
- 58
- 92
0
votes
1 answer
Express.js and Zombie.js - Can't seem to parse Javascript assets
I have an Express.js app that uses connect-asssets to serve JS and CSS:
app.configure(function() {
app.set('port', 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(connectAssets({src:…

Romain
- 2,318
- 1
- 23
- 31
0
votes
2 answers
Using connect vhost to serve multiple express.js apps
I want to use connect's vhost functionality to deploy several express.js apps to my dev vps. Here is my server.js file that is supposed to send requests to the appropriate place:
var express = require('express')
var quotes =…

Msencenb
- 5,675
- 11
- 52
- 84
0
votes
1 answer
Express res.redirect() behaving very strangely
I'm using a customized version of the vhost connect/express middleware and inside it I check for the www subdomain. If I find that subdomain, then I redirect to the host + path without the www. So for example, if I go to www.google.com I want to…

user730569
- 3,940
- 9
- 42
- 68
0
votes
2 answers
How do I use connect-assetmanager in my html/ejs template?
I may be completely misunderstanding how to use connect-assetmanager for my node project. But I have set up which js files I want to package up into a 'group' - but how do I refer to this group in my ejs/jade template?
Surely I need to somehow…

Joerg
- 3,553
- 4
- 32
- 41