Questions tagged [express]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Node.js Controller file

exports.getUsers = catchAsync(async (req, res, next) => { const features = new APIFeatures(User.find(), req.query) .filter() .sort() .limitFields() .paginate(); const users = ...
0
votes
0answers
10 views

Express js Invalid ip address in morgan logs when using nginx reverse proxy

I have a rest api in express js. I'm using a express-rate-limiter to limit requests like so. const limiter = rateLimit({ windowMs: 60 * 60 * 1000, // 60 minutes max: 1000, // limit each IP to 1000 ...
0
votes
0answers
8 views

Cannot POST /api/user/cart/addtocart%0A

I'm creating a cart page for an e-commerce website. When I try to make a post request to create a cartItem in postman it shows me an error Cannot POST /api/user/cart/addtocart%0A Can anyone help me, ...
-1
votes
0answers
6 views

Meaning of context in graphql

i'm currently learning graphQL with node.js and mongoDB, and i couldn't understand something that i see in this course... I know that we have to pass the typeDefs, and the resolvers creating the new ...
0
votes
0answers
5 views

multer upload within an if condition from the form

I am trying to create an upload form. My html form has either upload from local pc, or import from url, so I need to the server-side code to adapt: I faced an issue with parsing form body but thanks ...
0
votes
1answer
8 views

How can I set the domain attribute in express-session based on the request origin?

I'm using express session. I set the domain domain: 'mydomain.com' so that the session cookie can be set between subdomains- like api.mydomain.com and staging.mydomain.com. But this prevents the Set-...
0
votes
0answers
4 views

H13 desc=“Connection closed without response” Node

I have this small little weather app that works just fine locally but I can't figure out how to deploy it on Heroku, it always crashes with H13 error. Here's the logs: 2021-04-06T19:47:08.155540+00:00 ...
0
votes
2answers
25 views

How to make a array from another array with grouping data based on id .?

I have a array object as follows, const data = [ { "order_id":"ORDCUTHIUJ", "branch_code":"MVPA", "total_amt":199500, "...
0
votes
0answers
12 views

Failed to load resource: the server responded with a status of 404 (Not Found) CANNOT GET

When the user try to signin/sign up it displays the following error: [![Failed to load resource: the server responded with a status of 404 (Not Found)][1]][1] The code is in the following image: [1]: ...
0
votes
0answers
10 views

Use DB if Redis is down

I am trying to get my app to be as independent from Redis as possible. Ideally, if there is an alive connection between the app and Redis it should be utilized. But if that connection somehow breaks ...
0
votes
0answers
6 views

I cannot access req.body. console.log doesn't print the request object;

const { render } = require("ejs"); const express= require("express"); const app = express(); const path = require('path'); app.use(express.static('views')); app.set('view ...
0
votes
1answer
10 views

uploading multiple FormField objects containing image data arrays from angular to express

I am trying to upload two FormField objects along with form data to express. The part im stuck at is using the multer library in express to extract this data from the request. I can access the form ...
0
votes
2answers
14 views

How to perform an SQL query that will return a combined data from 2 tables based on id

I have 2 tables, Products Categories When I query SELECT * FROM categories, I get this: [ { "id": 1, "title": "Shoes" }, { "id&...
0
votes
0answers
6 views

post request express to json local file

I am trying to make a quick mock for a project where I submit a form, the value will be posted to a local JSON file. my Get request works and returns the data from the JSON file, however, I am ...
0
votes
1answer
14 views

ReferenceError: describe is not defined WHEN run npm run dev

Any something wrong with my package.json? The test is green when I run npm run test. But when I run npm run dev, the test is also run. There is no command config I write that it should run test when I ...

15 30 50 per page
1
2 3 4 5
5034
 
久草视频新免费_日韩视频一中文字暮_欧美三级片