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.

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

The official website of Express.js is expressjs.com. The source can be found on GitHub.

Useful links:

Older versions

94248 questions
16
votes
1 answer

Express.js : What is the difference between res.attachment and res.download?

What is the difference between res.attachment and res.download and when to use which I am bit confused. In my case, I send my form data to the server as a JSON which will create a file out of it and respond with a download link. Which among the two:…
Rohit Rane
  • 2,790
  • 6
  • 25
  • 41
16
votes
2 answers

How can I use a LetsEncrypt SSL cert in my Heroku Node Express app?

I have a Node Express app running on Heroku that I want to encrypt with a free-of-charge SSL cert from LetsEncrypt. However, the methods I've seen require opening up ports 443 and 80 to allow the ACME process to work. Heroku only gives you one…
stone
  • 8,422
  • 5
  • 54
  • 66
16
votes
2 answers

Difference between multer, multiparty and connect-multiparty + Nodejs

Am new to Node world. UseCase : Was having a simple scenario of uploading XLS files on Angular front, process them on Node, make some manipulations and then save JSON on to Mongo DB. After receiving files from Angular, i was searching what is…
BeingSuman
  • 3,015
  • 7
  • 30
  • 48
16
votes
2 answers

Building a simple news feed in node + Mongodb + Redis

My goal is to build a simple news feed in node.js with the help of mongodb and redis. It similar like twitter So the scenario is pretty straight forward, once User A follow User B. Later on User's A News feed (Home page) will be shown User B's…
sinusGob
  • 4,053
  • 12
  • 46
  • 82
16
votes
2 answers

Is it possible to use Webpack-Hot-Middleware with NGINX on server side?

I am working on a project for a client and I need to use webpack's Hot Module Replacement feature. I am using an express (node) application behind NGINX. I am using many javascript frameworks to design the application, React happens to be one of…
16
votes
2 answers

Node Express specific timeout value per route

I'm developing a Node v4.2.4 application using Express v4.13.4. Now I would like to increase the timeout time for a specific upload route. From what I've read and experienced: the default Node server timeout is 2 minutes a Node socket has no…
ndequeker
  • 7,932
  • 7
  • 61
  • 93
16
votes
3 answers

node.js noobie trying to follow a tutorial - need to change jade reference to pug

I'm trying to follow this tutorial to learn about node.js: http://cwbuecheler.com/web/tutorials/2014/restful-web-app-node-express-mongodb/ When I run "npm install" some of the messages I see include this: npm WARN deprecated jade@1.11.0: Jade has…
Happydevdays
  • 1,982
  • 5
  • 31
  • 57
16
votes
2 answers

Weird characters in body after request response

I am using NodeJS and Request to post JSON and get a result with data in it. I set this request up with Postman and I get the JSON data back which is completely readable. { "d": { "__type": "Qvision.WoningenModule.Lib.aanbodcollection", …
Jelmer
  • 949
  • 3
  • 10
  • 23
16
votes
1 answer

Pug (formerly Jade) Variables Not Working (Interpolating) Correctly Inside Anchor Href

I'm playing around with Node and Express and I'm using the Pug (formerly Jade) templating engine to render my html. Everything has been working fine up until I started trying to inject variables into the href of my anchor links. Whats odd is that if…
Corey
  • 481
  • 2
  • 5
  • 11
16
votes
4 answers

RangeError: Invalid status code: 0

I am having an issue where I am getting the following error code when attempting a POST request on this application (bearing in mind I am a beginner node.js/js programmer): Error: [20:22:28] [nodemon] starting `node app.js` Running server on…
Matt
  • 343
  • 2
  • 3
  • 8
16
votes
1 answer

How to serve production react bundle.js built by webpack?

My app works fine in webpack development server. Now, I want to deploy it to my production server. So I built bundle.js. I tried serving the file on express server, but I can't access urls other than the root /. For example, here is my react…
Komsit Prakobphol
  • 173
  • 1
  • 1
  • 8
16
votes
5 answers

Using loops and promises in transactions in Sequelize

I am currently building a Nodejs, Express, Sequelize (w. PostgreSQL) app, and have run into a few problems with using promises together with transactions and loops. I am trying to figure out how to use a for loops in a transaction. I am trying to…
ReturnToZero
  • 375
  • 1
  • 3
  • 16
16
votes
8 answers

How to validate password using express-validator npm

I am writing rest API using node , express web module. For validation I am using express-validator npm. I want to apply some validation rules on password field. How can I achieve it using express-validator? What validation rules I want to apply for…
Sunil Sharma
  • 1,297
  • 3
  • 17
  • 31
16
votes
3 answers

How to serve two web applications behind an nginx reverse proxy

I have two web applications (node.js express apps), web1 and web2. These web apps expect to be hosted on sites that are typically something like http://www.web1.com and http://www.web2.com. I'd like to host them behind an nginx reverse proxy as…
Erik
  • 7,479
  • 8
  • 62
  • 99
16
votes
3 answers

When Serialize and Deserialize call in passport js

I have to know when Serialize and Deserialize called, for testing I have put alert(user.id) but no action happened. I have some queries: From where user object has received in passport.serializeUser(function(user, done){... What role play…
vineet
  • 13,832
  • 10
  • 56
  • 76
1 2 3
99
100