Most voted "express" questions
Express is a minimum framework for Node.js web applications that provides a set of features for web and mobile applications.
Learn more…400 questions
Sort by count of
-
1
votes0
answers111
viewsWeb Service for multiple databases
I’m starting with Node.js and wanted to know if someone could give me a strength in the matter of making a Web Service for multiple databases. I already have a code developed for Mysql, I need to…
-
1
votes1
answer51
viewsManipulation of Middleware
I’m trying to do the following manipulation on Expressjs. I took an MEAN Stack project and the person I was developing came out and I’m just following through. But now I’ve come across the following…
-
1
votes0
answers56
viewsHow to organize an Express.js application
Given that express has no integrated "autoload" functionality, what would be the best structure or Boilerplate to follow in a large monolithic project? and how to raise it?
-
1
votes1
answer57
viewsLink in the terminal
Is there any way to make when the localhost:3000, who is in the terminal, be pressed ctrl + click the browser opens on the page in question ( localhost:3000 ) ... this in a Javascript code :…
-
1
votes0
answers1093
viewsSession at Node.JS
I was reading that the middleware Express Session it is not ideal to work in production, because it archives the sessions in memory. I also read that storing session data in memory is not a good…
-
1
votes1
answer162
viewsMaintain req.body parameters when changing course
Hello, my question is this:: I am using Express/bodyParser and Nunjucks. I submitted a form with the method POST from my root route '/'. In the form I have two dice: Username Date of birth In the…
-
1
votes1
answer4034
viewsNodejs - Typeerror: Cannot read Property 'get' of Undefined
I am beginner in Nodejs and I came across this problem when I was exporting a module: "Typeerror: Cannot read Property 'get' of Undefined". I did not understand why the error occurred since the code…
-
1
votes0
answers769
viewsJson object in Ionic 2
I’m starting with Ionic 2 and Node.js and I’m trying to consume the API I created, but I’m having trouble locating the problem when I try to generate a ngFor listing from a JSON, so I’ve read ngFor…
-
1
votes2
answers118
viewsWhy is object property automatically transformed into a string?
I’m using Nodejs and I have this problem: I have the following object: let obj = { id : { $gte : 5 } }; console.log(obj); //Resultado: { id: { '$gte': '5' } } Note that in the result, the property…
-
1
votes1
answer82
viewsHow do you associate a calculus function within an express function to use in Routes?
To with a very big doubt, I have a function that makes calculations of users' metrics and I want to put it in an express function to be able to return a JSON and use it in a route, It follows the…
-
1
votes2
answers130
viewsNode.js I cannot access a class property in class method
Fala galera, this starting to study Node.js, I’m doing an exercise here I’m encountering the following problem: In this case, I am not being able to access this.Ojects property, which was started in…
-
1
votes0
answers77
viewsSharing routes on express
I’m trying to make a generic controller that will provide the basic crud routes, the idea is to extend this controller and be able to add some custom routes that are only inherent in that class.…
-
1
votes1
answer34
viewsapp.set('x-powered-by', false) does not work on expressjs
Hello, in my main code of my app, with the use of express, I’m trying to remove the "x-powered-by" header, and I’ve used so much app.disable("x-powered-by") how much app.set("x-powered-by", false)…
-
1
votes0
answers62
viewsServe custom . js file in Express route
I have a specific "home" page for authenticated user that is served by a router however this authentication is made via cookie if there is this cookie "session" (created after user login and set…
-
1
votes1
answer644
viewsObject.<Anonymous> (Express + Middleware)
> > node index.js C:\Users\cpsep\Projetos\nodejs\semparar\node_modules\express\lib\express.js:107 > throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express…
-
1
votes1
answer2316
viewsWhat is the function of the.Switch app in Express?
I recently started my studies in Nodejs and Express. From what I’ve been reading, app.Leann is basically what makes the server listen to requests coming from the defined port. But I could notice…
-
1
votes1
answer62
viewsWhy is the POST not working on my Mongodb?
Whenever I execute the post command the Inuit returns me an empty User. router.post('/register', async (req,res) => { const { email } = req.body; try { if (await User.findOne({ email })) return…
-
1
votes2
answers7102
viewsTypeerror: Extractjwt.fromAuthHeader is not a Function
I’m having some problems with Passaport.js. When I try to run my api, the terminal returns an error. I went to the file in question and found nothing wrong. I did a web search, but the solutions I…
-
1
votes0
answers61
viewsPost Error - Payload (Node.js)
Today when I went to perform the post of a larger base 64 is returning it from my server. When uploading a smaller image it sends smoothly, I tried using some solutions limiting the server to 50mb…
-
1
votes1
answer445
viewsReturn Javascript script with Node.JS
Using Node.JS I want to read a Javascript script in a folder and return it. It turns out that when I access the file through the browser, the code appears normally. But the script is not embedded in…
-
1
votes2
answers65
viewsExpress JS Routing
I am new to using Express JS and would like to make a direction according to the session created, IE, according to the user profile, the application has an initial route "audit" and will have 2 user…
-
1
votes1
answer606
viewsSearch by id Mongo
Hello guys I’m following the book Getting Mean but I stumbled across a problem I can’t solve. I have a document I show below taking data from Mongo, and in it I have subdocuments in the case Reviews…
-
1
votes1
answer1991
viewsRemove Timezone on request with Node.js and express.js
I have a API with node.js and express.js. In the database the fields of the type datetime are saved correctly, but in response to a request GET date fields come with 3 hours more due to time zone.…
-
1
votes0
answers34
viewsDecrease code Nodejs
Hi, I’m developing a nodejs system with the express. However I’m facing something I don’t know yet how to solve, I need a code of mine to return result of a bank query: query = 'SELECT id FROM…
-
1
votes1
answer1393
viewsres.json Nodejs/ Express
I have a cruel doubt in nodejs/ Express, I am very new in language but what I need is to pass the id in a route to execute and return a query. I’m wanting to do in fragmented files, so I have a…
-
1
votes1
answer576
viewsUse javascript inside an EJS file to display array information
I’m trying to show inside an EJS/html file the values of an array that are sent from the server, but I’m not getting it. I know that to show the value of a variable inside an EJS file all I need to…
-
1
votes1
answer1145
viewsExpress return post
Good afternoon, I am having a problem in the return of POST on express, I wanted to register users using the following code : router.post('/user', (req,res,next) =>{ var obj =…
-
1
votes1
answer132
viewsPassport forwarding error with express 4
I am having problems after user authenticate in form. Passport redirects to the root again, however it does not pass to the express GET of the route '/' and displays [Object Object]. If use…
-
1
votes1
answer129
viewsList items of an object in Pug JS, with Node and Mongo
I’m setting up a store, using Keystone JS, installed the dependencies Pug JS and Mongodb. I created a model that is pointing to a view, called Tour.JS The problem is that I couldn’t efficiently list…
-
1
votes2
answers427
viewsHow to give a disabled in a form depending on which radio button to choose?
Good afternoon... I have the following radio Buttons: <input type="radio" name="radio1" value="entrada"> Entrada <input type="radio" name="radio1" value="saida"> Saida I also have the…
-
1
votes1
answer20
viewsI need to create a route that changes the project title with the id present in the route parameters. But when testing the route I get error 500
I need to create a route that changes the project title with the id present in the route parameters. But when testing the route I get error 500(Typeerror: Cannot set Property 'title' of Undefined)…
-
1
votes1
answer1580
viewsEJS include dynamic
Using Express 4 and template engine EJS, I came across the following: Let’s say I have the following structure: meu_projeto/ +-- server.js +-- views/ ¦ +-- layout.js ¦ +-- admin/ ¦ ¦ +-- index.js ¦…
-
1
votes1
answer404
viewsError creating a table with sequelize "Typeerror: Cannot read Property 'sequelize' of Undefined"
I have the following error when trying to create a table: const Usuario = app.db.sequelize.define('user', { Typeerror: Cannot read Property 'sequelize' of Undefined My folder structure: My…
-
1
votes1
answer893
viewsNodejs function, functioning
app.get('/', function(req, res){ res.send('Ola Mundo'); }); In the case of this simple code just to illustrate we have a function in nodejs with 2 parameters the request and the answer, I was…
-
1
votes0
answers63
viewsAn OPTIONS is generated when a POST is made
I have an API and I’m trying to connect with an online store but every time I try to perform a POST is returned an OPTIONS. I decided to use JWT to authenticate orders and avoid OPTIONS but without…
-
1
votes0
answers212
viewsDoubts of ACL with Node.js!
People I am trying to apply Authorization (ACL) using the plugin npm "node_acl" in a Node.js application with express, I am trying to implement as explained in the documentation.. however I am…
-
1
votes0
answers56
viewsJWT and Passport returns 401 React
good afternoon. I am learning JWT and Passport and I am facing problems with the same, the problem is the following, I can log in and save in Localstorage, and redirect to another page however, even…
-
1
votes1
answer471
viewsreq.body nãp works on Express
I’m trying to read parameters sent via post, but the express only shows on the console.log empty objects. This is the code import * as jsonServer from 'json-server' import {Express} from "express";…
-
1
votes0
answers455
viewsVariable in the EJS
Good morning, everyone! So, come on: I’m trying to use Plotly to generate a bar graph, and it accepts variables. I have a connection on NODE.JS with a database and, NODE.JS in thesis (After a…
-
1
votes1
answer38
viewsHow to separate errors from a query in an expressjs api
What is the correct method to separate errors from a query? The current code compares the error manually with the message generated by mysql, in case the query may go wrong for several reasons,…
-
1
votes0
answers542
viewsNodejs Error: "ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client"
Good, I have a problem in my application, however I still can not understand well the reason for this error, since this only happens if a user update his password and then try to login. //Function…
-
1
votes0
answers407
viewsreq.body returning Undefined when using consign in the application
I am familiar with express, so I created a simple form with two fields, I have a JS file where I receive the data of the form and send them through the xmlHttpRequest and on the server side, I’m…
-
1
votes1
answer31
viewsRoute is not executed when called after Paypal checkout
Successful route is not activated after Paypal checkout that redirects to /Success PS: My view is in English. This is the part that is not being called when accessing /Success app.get('/success',…
-
1
votes1
answer1299
viewsAxios GET Request Response is Undefined
I’m trying to make an Next call in my Node JS Express app and sending the data to my index.ejs file. The problem is that i can see the data in my callApijavascript file but i cant access the…
-
1
votes1
answer365
viewsPublic Directory - Node.js
Public Directory Node.js I’m having problems releasing a public directory on Node.js. I need everything in the directory public is accessible via direct URL. I’ve tried to use…
-
1
votes1
answer143
viewsIs it correct to create two servers in the same Nodejs app with Express?
I am creating a Nodejs application with Express and I am looking to observe all the "best practices" recommended for system security. In this system I’m thinking of having two open ports (but I…
-
1
votes0
answers794
viewsHow to send form parameters using Express and Node.js
Hello, I’m trying to post the data of a form using Express, follow the code below index.html <form action="insere" method="post"> <p><h4> Título </h4> <input type="text"…
-
1
votes0
answers128
viewsTypeerror: Cannot read Property 'id' of Undefined
Routes: const express = require('express'); const router = express.Router(); const controller = require('../controllers/imoveis-controller'); router.get('/:id', controller.getById); router.get('/',…
-
1
votes1
answer269
viewsNODE/EXPRESS/BODY-PARSER I’m not able to read the body, keeps giving UNDEFINED
Well I’m going to post the index here for you to look at, I reworked the code and it worked for another purpose, but with this purpose of taking the information and sending it to the Undefined…
-
1
votes1
answer189
viewsProblem with routes
When trying to access konic.com.br the site is loaded normally, but when I enter another route that in the case of konic.com.br/contact it returns 404 app js.: const express = require("express");…