Skip to main content
Filter by
Sorted by
Tagged with
2127 votes
19 answers
2.2m views

I've been trying to find a way to write to a file when using Node.js, but with no success. How can I do that?
Gjorgji's user avatar
  • 23.2k
1239 votes
49 answers
2.2m views

I'm fairly new to Node.js and I am having some issues. I am using Node.js 4.10 and Express 2.4.3. When I try to access http://127.0.0.1:8888/auth/facebook, i'll be redirected to http://127.0.0.1:...
DjangoRocks's user avatar
  • 14.2k
917 votes
12 answers
670k views

I installed Express.js with the following command: sudo npm install -g express I get the following warnings: npm WARN package.json [email protected] No repository field. npm WARN package.json fresh@...
JR Galia's user avatar
  • 17.3k
773 votes
39 answers
935k views

I am trying to support CORS in my Node.js application that uses the Express.js web framework. I have read a Google group discussion about how to handle this, and read a few articles about how CORS ...
mikong's user avatar
  • 8,390
706 votes
10 answers
789k views

I know how to get the params for queries like this: app.get('/sample/:id', routes.sample); In this case, I can use req.params.id to get the parameter (e.g. 2 in /sample/2). However, for url like /...
Hanfei Sun's user avatar
  • 47.3k
655 votes
6 answers
194k views

This may be a very basic question but I simply don't get it. What is the difference between creating an app using Express.js and starting the app listening on port 1234, for example: var express = ...
Tamas's user avatar
  • 11.3k
617 votes
11 answers
1.1m views

So, one can attempt to fetch the following JSON object: $ curl -i -X GET http://echo.jsontest.com/key/value/anotherKey/anotherValue HTTP/1.1 200 OK Access-Control-Allow-Origin: * Content-Type: ...
MightyMouse's user avatar
  • 13.9k
578 votes
53 answers
772k views

I have this as configuration of my Express server app.use(app.router); app.use(express.cookieParser()); app.use(express.session({ secret: "keyboard cat" })); app.set('view engine', 'ejs'); app.set("...
Masiar's user avatar
  • 21.5k
504 votes
10 answers
241k views

I am a learner in Node.js. What's Express.js? What's the purpose of it with Node.js? Why do we actually need Express.js? How is it useful for us to use with Node.js? What's Redis? Does it come with ...
vinod's user avatar
  • 8,430
485 votes
27 answers
649k views

In Ubuntu it's quite simple; I can run the application using: $ NODE_ENV=production node myapp/app.js However, this doesn't work on Windows. Is there a configuration file where I can set the ...
Jack's user avatar
  • 15.9k
465 votes
19 answers
1.4m views

I'm running an Express.js application using Socket.io for a chat webapp and I get the following error randomly around 5 times during 24h. The node process is wrapped in forever and it restarts itself ...
455 votes
27 answers
1.1m views

I have come across CORS issues multiple times and can usually fix it but I want to really understand by seeing this from a MEAN stack paradigm. Before, I simply added middleware in my express server ...
mibbit's user avatar
  • 5,415
443 votes
34 answers
1.6m views

I'm receiving this error when trying to debug my node application using the npm start command. Error: npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "...
Andrew Moll's user avatar
  • 5,053
438 votes
32 answers
538k views

All of a sudden this has been happening to all my projects. Whenever I make a post in nodejs using express and body-parser req.body is an empty object. var express = require('express') var ...
Joseph Dailey's user avatar
405 votes
9 answers
131k views

I'm starting with NodeJS and Express 4, and I'm a bit confused. I have been reading the Express website, but can't see when to use a route handler or when to use express.Router. As I could see if I ...
nelson687's user avatar
  • 4,533
388 votes
25 answers
602k views

function generate(count) { var founded = false, _sym = 'abcdefghijklmnopqrstuvwxyz1234567890', str = ''; while(!founded) { for(var i = 0; i < count; i++) { ...
owl's user avatar
  • 4,539
378 votes
17 answers
576k views

i've created a small API using Node/Express and trying to pull data using Angularjs but as my html page is running under apache on localhost:8888 and node API is listen on port 3000, i am getting the ...
user1336103's user avatar
  • 3,897
362 votes
27 answers
388k views

I've reduced my code to the simplest express-js app I could make: var express = require("express"), app = express.createServer(); app.use(express.static(__dirname + '/styles')); app.listen(3001); ...
Kit Sunde's user avatar
  • 37.3k
360 votes
10 answers
631k views

I am using express to make a web app in node.js. This is a simplification of what I have: var express = require('express'); var jade = require('jade'); var http = require("http"); var app = express();...
Enrique Moreno Tent's user avatar
354 votes
25 answers
777k views

I am sending requests from the client to my Express.js server using Axios. I set a cookie on the client and I want to read that cookie from all Axios requests without adding them manually to request ...
Kunok's user avatar
  • 8,849
350 votes
24 answers
586k views

FBFriendModel.find({ id: 333 }, function (err, docs) { docs.remove(); //Remove all the documents that match! }); The above doesn't seem to work. The records are still there. Can someone fix?
TIMEX's user avatar
  • 275k
333 votes
12 answers
513k views

Basically I have a mongodb collection called 'people' whose schema is as follows: people: { name: String, friends: [{firstName: String, lastName: String}] } Now, I have a ...
Neurax's user avatar
  • 3,757
332 votes
16 answers
783k views

I have started a Node server through the plugin of an IDE. Unfortunately, I cannot use the IDE's terminal. So I tried to run the script from the command line. This is the problem - I am using the ...
KA.'s user avatar
  • 4,554
307 votes
13 answers
348k views

In my NodeJS express application I have app.js that has a few common routes. Then in a wf.js file I would like to define a few more routes. How can I get app.js to recognize other route handlers ...
rafidude's user avatar
  • 4,646
293 votes
6 answers
464k views

This is my app that I'm currently running on production. var app = express(); app.set('views',settings.c.WEB_PATH + '/public/templates'); app.set('view engine','ejs'); app.configure(function(){ ...
TIMEX's user avatar
  • 275k

1
2 3 4 5
1900