Node.js global variables
I asked here: Does Node.js require inheritance? And I was told that I can set variables to the global scope by leaving out … Read more
I asked here: Does Node.js require inheritance? And I was told that I can set variables to the global scope by leaving out … Read more
I want to simulate a 404 error on my Express/Node server. How can I do that? 6 Answers 6
How can I make an HTTP request from within Node.js or Express.js? I need to connect to another service. I am hoping the … Read more
I’ve been trying to get HTTPS set up with a node.js project I’m working on. I’ve essentially followed the node.js documentation for this … Read more
In my application, I need to set a cookie using the express framework. I have tried the following code but it’s not setting … Read more
I have tried: app.get(“https://stackoverflow.com/”, function(req, res, next) { var e = new Error(‘error message’); e.status = 400; next(e); }); and: app.get(“https://stackoverflow.com/”, function(req, res, … Read more
what is process.env.PORT || 3000 used for in Node.js? I saw this somewhere: app.set(‘port’, process.env.PORT || 3000); If it is used to set … Read more
I’m a beginner in Express.js and I’m confused by these two keywords: res.end() and res.send(). Are they the same or different? 7 Answers … Read more
I am playing around with Nodejs and express by building a small rest API. My question is, what is the good practice/best way … Read more
Is there a way to add created_at and updated_at fields to a mongoose schema, without having to pass them in everytime new MyModel() … Read more