node.js-connect Questions

13

Solved

I'm trying to start serving some static web pages using connect like this: var connect = require("connect"); var nowjs = require("now"); var io = require("socket.io");...
Haldan asked 9/3, 2012 at 0:52

9

Solved

It appears that this simple app can't find the 'connect' module after I just installed it in the file directory. var connect = require ('connect'); connect.createServer(function(res, req, next) ...
Hospodar asked 12/3, 2013 at 1:59

10

I have a problem with this little program: var http = require("http"); var request = http.request({ hostname: "localhost", port: 8000, path: "/", method: "GET" }, function(response) { var sta...
Cranberry asked 4/2, 2016 at 11:5

7

Solved

I have a POST request with very simple and small amount of form data. How can I most easily access it? Many tutorials/posts etc talk about bodyParser, but this is no longer bundled with Express. Ot...
Hierocracy asked 17/7, 2014 at 10:3

6

Solved

I am using Express 3, and would like to handle text/plain POSTs. Express 3 uses connect's bodyParser now (I think the old Express code got moved to connect). The documentation for bodyParser give...
Skeie asked 19/9, 2012 at 14:58

12

Solved

I have written a small Node.js app, using connect, that serves up a web page, then sends it regular updates. It also accepts and logs user observations to a disk file. It works fine as long as I am...
An asked 26/12, 2012 at 17:25

6

Solved

I have a few middlewares that I want to combine into one middleware. How do I do that? For example: // I want to shorten this... app.use(connect.urlencoded()) app.use(connect.json()) // ...into th...
Nerve asked 28/11, 2013 at 20:46

2

Solved

this is my message.test.js file. var expect = require('expect'); var {generateMessage} = require('./message'); describe('generateMessage', () => { it('should generate correct message obje...
Kilo asked 4/4, 2018 at 10:9

4

Solved

I am trying to retrieve something from the post, and need the rawBody property from the incoming request. How can I retrieve it? I tried using express.bodyParser() and in my post handler, I was loo...
Seymour asked 14/7, 2013 at 23:30

7

Solved

Is there a canonical way to remove middleware added with app.use from the stack? It seems that it should be possible to just modify the app.stack array directly, but I wonder if there is a document...
Indecorum asked 3/9, 2013 at 22:33

8

Solved

I am using nodejs + Express (v3) like this: app.use(express.bodyParser()); app.route('/some/route', function(req, res) { var text = req.body; // I expect text to be a string but it is a JSON }); ...
Herold asked 10/9, 2012 at 3:57

5

Solved

A newbie with NodeJs. I am trying to follow AngularJS pro and got stuck with setting up NodeJs server. According to book, I installed nodejs and then installed connect package using npm install con...
Obeah asked 21/6, 2014 at 21:50

4

Solved

I would like to do something like: app.On_All_Incoming_Request(function(req, res){ console.log('request received from a client.'); }); The current app.all() requires a path, and if I give for exa...
Groggery asked 31/8, 2011 at 21:25

2

Solved

I have been using express webservers since I started working on Node.js and a few days ago I came across this new (to me) web server, called connect. Can anyone point out, what are the differences...
Exarch asked 24/5, 2018 at 8:20

7

Solved

I'm using Node.js + Express to build a web application, and I find the connect BodyParser that express exposes to be very useful in most cases. However, I would like to have more granular access to...

5

Because I didn't define a maxAge when calling expressServer.use(express.session({params})) the cookie's expiration is set as "Session". I would like to add a "remember me" featu...
Gingery asked 27/12, 2012 at 4:15

4

Solved

I am writing a little demo web server delivering static html,css and javascript. The server looks like (function () { "use strict"; var http = require("http"); var connect = require('connect')...
Pelmas asked 15/6, 2013 at 14:19

7

Solved

I want to be able to host multiple NodeJS apps under the same domain, without using sub-domains (like google.com/reader instead of images.google.com). The problem is that I'm always typing the firs...
Hachure asked 7/12, 2010 at 10:20

1

Solved

I've put together a proxy server in Node that needs the ability to tunnel https requests over tls and that all works. Using the the following two packages this was extremely easy to setup: proxy, h...
Trimurti asked 26/7, 2017 at 13:43

1

I am starting live reload via Gulp: var $$ = require('gulp-load-plugins')(); gulp.watch('*', function (file) { $$.livereload().changed(file.path); }); gulp.task('connect', function(){ var conn...
Bertabertasi asked 22/10, 2014 at 10:52

3

Solved

I have very recently received a lot of traffic to my site that runs Node.js. With the increasing traffic it has started to crash a lot, which has not happened before. I get the following error in m...
Avestan asked 27/4, 2012 at 17:53

2

I am creating a NodeJS web application via ExpressJS. I have the following two routes (among others): app.get('/user/reset/verify', function(req, res) { console.log("Executing verification index....
Wolfe asked 20/9, 2011 at 1:43

3

Solved

Does anybody know a way in express.js to capture requests in a single function for both html and json? Essentially I want a single route for both /users and /users.json - like rails does with its...
Oesophagus asked 19/1, 2012 at 15:30

4

I am receiving this error when trying to delete a document from the database: Cannot GET /delete/532fa5e56f885c7fec5223b1fds How can I successfully delete the document? app.js //Delete app...
Homothermal asked 24/3, 2014 at 4:56

2

Solved

I am trying to make a middleware for handling url aliases, what I am doing right now is : // [...] module.exports = function() { return function(req, res, next) { // getAlias would get an objec...
Sequent asked 29/9, 2013 at 15:0

© 2022 - 2024 — McMap. All rights reserved.