Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [express]

Express.js is a minimal and flexible Node.js web application framework providing a robust set of features for building web applications.

1222 votes
49 answers
2.1m views

Error: Can't set headers after they are sent to the client

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.1k
768 votes
37 answers
905k views

Why doesn't adding CORS headers to an OPTIONS route allow browsers to access my API?

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,340
1598 votes
27 answers
1.9m views

How to get GET (query string) variables in Express.js on Node.js?

Can we get the variables in the query string in Node.js just like we get them in $_GET in PHP? I know that in Node.js we can get the URL in the request. Is there a method to get the query string ...
XMen's user avatar
  • 30.1k
2112 votes
18 answers
2.1m views

Writing to files in Node.js

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
  • 23k
920 votes
24 answers
957k views

How to access POST form fields in Express

Here is my simple form: <form id="loginformA" action="userlogin" method="post"> <div> <label for="email">Email: </label> <input type="text" id="email" ...
murvinlai's user avatar
  • 49.9k
453 votes
19 answers
1.2m views

How do I debug error ECONNRESET in Node.js?

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 ...
376 votes
17 answers
560k views

No 'Access-Control-Allow-Origin' - Node / Apache Port Issue

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,879
331 votes
12 answers
501k views

Push items into mongo array via mongoose

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,717
456 votes
7 answers
650k views

Download a file from NodeJS Server using Express

How can I download a file that is in my server to my machine accessing a page in a nodeJS server? I'm using the ExpressJS and I've been trying this: app.get('/download', function(req, res){ var ...
Thiago Miranda de Oliveira's user avatar
819 votes
34 answers
779k views

Error: request entity too large

I'm receiving the following error with express: Error: request entity too large at module.exports (/Users/michaeljames/Documents/Projects/Proj/mean/node_modules/express/node_modules/connect/...
mike james's user avatar
  • 9,310
564 votes
53 answers
737k views

Express.js req.body undefined

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.1k
58 votes
1 answer
123k views

CORS Error: “requests are only supported for protocol schemes: http…” etc

I am trying to run a simple application. I have an Express backend which returns a JSON string when visited at localhost:4201/ticker. When I run the server and make a request to this link from my ...
Abrar Hossain's user avatar
634 votes
10 answers
678k views

Enabling HTTPS on express.js

I'm trying to get HTTPS working on express.js for node, and I can't figure it out. This is my app.js code. var express = require('express'); var fs = require('fs'); var privateKey = fs.readFileSync('...
Alan's user avatar
  • 46.6k
55 votes
10 answers
139k views

How to enable cors nodejs with express?

In summary I am using a viewer like api of dicom files called cornerstone, for this I connect to the WADO service of dc4chee to get the dicom, dcm4chee runs port 8080, and my application on node uses ...
M. Node's user avatar
  • 743
272 votes
12 answers
511k views

static files with express.js

I want to serve index.html and /media subdirectory as static files. The index file should be served both at /index.html and / URLs. I have web_server.use("/media", express.static(__dirname + '/media'...
user124114's user avatar
  • 8,548

15 30 50 per page
1
2 3 4 5
412