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
-
0
votes2
answers383
viewsHow to export and use a Local Middleware with Express Route?
I’m having two difficulties which are: 1) I’m trying to export and use mine middleware to be used locally. 2) I would also like to know if it is possible to use a middleware for a specific request…
-
0
votes1
answer61
viewsHow to use a const with middleware and Routes?
I have the following const in my file Routes.js: const database = []; For learning purposes I’m using it as if it were my own "database", where according to the type of request I handle this…
-
0
votes1
answer88
viewsVariable does not change in nodejs
I am developing a Node application for Guardhouse Communication (API) and I am having trouble changing the value of a variable. follows below the code: var net = require("net"); var express =…
-
0
votes0
answers386
viewsProblems passing Query String as parameter in nodejs
I’m trying to make the functionality of login in the Nodejs, for this I created a method get who receives the email and the password as Query String and performs a query in the database (MySQL)…
-
0
votes2
answers91
viewsConsuming webservice, login screen
Good morning! To create a project in JS, EJS and Express.js for studies, to consume a list of cars using webservice: https://carros-springboot.herokuapp.com/api/v1/carros On the login screen, using:…
-
0
votes0
answers74
viewsnodejs Doubt about module.Exports
Good evening. I have a question maybe a little bit simple but that is keeping me up at night and I think I’m doing it the wrong way. However, if someone can correct me and explain why I made a…
-
0
votes3
answers252
viewsHow to return value in a javascript function
I’m studying the framework Express to create a REST and when writing afunction I am unable to return the value that was processed. When making the call to endpoint /test, the code below is executed:…
-
0
votes2
answers109
viewsDo not redirect form - nodejs
I have a form where I send requests POST pro nodejs save in the database but when I send the information it is redirected to the route and I receive the res…
-
0
votes2
answers72
viewsMongoose’s Findone method is running in infinite loop
I have the following problem. I have a Findone method to search if a user exists in the database, according to the user and password. But when I run the method - using Inuit, it ends up in an…
-
0
votes2
answers362
viewsIs it possible to block access to a middleware route?
Guys, I have a public folder with all the "public" files from my site html,css,js etc. And another folder called private with all the file private files connected with database and etc, which is a…
-
0
votes1
answer202
viewsHow do I use variable value outside of your callback? Javascript
I’m trying to get the HTML of any URL (Google for example), to use it in my front end. First, I try my server.js Node with Express to get this HTML through the "request module":…
-
0
votes0
answers39
viewsCapturing except for routes on express
I write an application with Express and Typescript, and to capture the exceptions of the routes I do so: index ts. // ... app.use(userRoutes); app.use(handleError); // ... having 'handleError' in a…
-
0
votes1
answer111
views* Referenceerror: Session is not defined *
I’m having a problem, sharing the Express cookie user data and session functions! the goal is to store such data in my Socket.IO, but it presents a reference error problem where it says the session…
-
0
votes2
answers747
viewsHandlebars: Access has been denied to resolve the Property "title" because it is not an "Own Property" of its Parent
I’m having a problem with displaying mysql data by handlebars: Executing (default): SELECT `id`, `titulo`, `conteudo`, `createdAt`, `updatedAt` FROM `postagens` AS `postagens`; Handlebars: Access…
-
0
votes0
answers137
viewsPOST method does not work properly Node.js and express
good evening, by way of tests I created a small API to understand its functioning, however when running the POST method I found that it only returns me the empty keys: [ {} ] The correct thing would…
-
0
votes1
answer211
viewsQuery in Sequelize separating Month and Year
Hi, guys. Sorry if my question seems a bit silly, but I’m starting now and doing this query is tying my head in a knot kkk Next, I’m building a system to manage the company’s vouchers (advances). I…
-
0
votes1
answer214
viewsTest error with Jest and Supertest
Good afternoon, you guys; I created my tests with Jest and supertest, and they are giving an error "Object.is Equality", Versão Node: 12.18.3 Versão NPM: 6.14.4 Versão Yarn: 1.22.4 ps: I am using…
-
0
votes0
answers37
viewsHow do I access the value of an object in the view with handlebars when that object was created within a controller?
I created a controller file that has an object with some items being one of them a function that returns files from a folder. When giving console.log an array is returned with the files from this…
-
0
votes1
answer187
views400 Bad request on express and typeorm server
Hello, I’m trying to create a user, but when sending the post method with the user data I get one 400 Bad Request server, the problem is that the server is not understanding the data, in the error…
-
0
votes1
answer66
viewsDoubt about the body of the requisition
I was doing some tests and I realized that when sending a parameter with single and double quotes, an internal error occurs. Ex: password: teste'" Error: SyntaxError: Unexpected token i in JSON at…
-
0
votes1
answer39
viewsI am having a problem loading a Multer image on the server, the file loads to the path but not to the database
On my machine works perfectly, the image is loaded to the path and all data to the database but on the Ubuntu server with the same code and the same database only the image is loaded to the path and…
-
0
votes0
answers12
viewsUsing express with Bunyan (logs)
I created a logger with two streams for two different apps as an example: const bunyan = require('bunyan'); const {LoggingBunyan} = require('@google-cloud/logging-bunyan'); class bunyanLogger {…
-
0
votes0
answers33
viewsHow do I accept request with ISO-8859-1 charset?
I have in my system a POST route for my clients to send information. Where a client is trying to send a POST request with the following header: Content-Type: application/x-www-form-urlencoded;…
-
0
votes0
answers46
viewsPassport.js local Strategy returning error 'Missing credentials'
I am trying to make a login system (authentication) using the Passport and the Express. However, it always goes back to the log page and returns the error Missing Credentials, I have tried to search…
-
0
votes1
answer253
viewsPagseguro API 401 error - Unauthorized; Error logging in paid
[RESOLVED] I made a simple Node server to test the Pagseguro API and am having problems with error 401. In a video I saw that to make requests for the Pagseguro API it is necessary to have an SSL…
-
0
votes1
answer52
viewsHow to develop with Cooldown with Express-Session
Hello, I am developing a feedback system. The person fills in some data, sends and saves in the database. However, for security reasons, I wanted to create a cooldown so that the person only send…
-
0
votes0
answers29
viewsProblem with Body-Parser
I have a problem with Runtime of Javascriptthe NodeJs, I finished the modules bodyParser, express and handlebars Yet I can’t bring myself to parameter req, exactly the req.body.name and the…
-
0
votes1
answer109
views -
0
votes0
answers130
viewsMongoparseerror: Invalid Connection string Express+Mongo
I’m using for the first time the express and the Mongo, it works normally locally, no authentication, but when I went to cloud, in the Umbler hosting it started to show error Jan 07 14:05:19 } Jan…
-
0
votes0
answers40
viewsMy answer returns Undefined
I’m using Node to develop an application. I am making a query in the bank to pull some values. These values are: 'imagem1', 'imagem2, 'imagem3'. I want to use a for to apply a function in the 3…
-
0
votes0
answers36
views -
0
votes1
answer52
viewsHow to get the notificationCode from the Pagseguro notification URL?
In the details of the notification I have: The following parameters were sent via POST: notificationType=transaction notificationCode=D666218281808180F60334A66F8340B434F9 { "request": { "url":…
-
0
votes0
answers20
viewsExpress does not run route
This is my index, but when calling the drones route, it displays the error: CANNOT GET /drones/ But before it worked normally, it stopped working suddenly. const express = require('express'); const…
-
0
votes1
answer62
viewsHow popular is an object loaded with populate in Mongoose?
I have a doubt, if I already have a query being populated in Mongoose, and it is populated with a model that also has relationship, there is a way to popular it too? For example: I have my model of…
-
0
votes1
answer38
viewsRefresh page when making BD changes
Goal My final project involves making a chat room; the user must enter a message, this message is handled in the server.js(Node.js file) and inserted into the database. The page should then be…
-
0
votes1
answer91
viewsExpress runs but does not work. JS Node
Good afternoon everyone, I’m having a little problem with the server express in a Node JS application with typescript, typeorm and postgres SQL where when executing the command npm run dev the…
-
0
votes1
answer78
viewsHow to recover a customer’s IP?
I am working on my first professional project using Node.js. In it I make changes to security groups of EC2 AWS instances. One of the data in which the system performs updates is the client’s IP. I…
-
0
votes0
answers29
viewsExpressjs: Is he addicted?
Good morning, dear friends, I am with a project in Expressjs where the function is to use a login panel to generate an HTML file with EJS template containing the attributes of the user who logged…
-
0
votes1
answer73
viewsReferences with Mongoosis
I currently have 3 Collections in my project, and I need 2 of them ("Course" and "Lesson"), have a link, I want when adding a "Lesson" it to be inserted in a "Course" through a push, but is giving…
-
0
votes0
answers43
viewsload infinity nodejs
Hello, I am doing a small application in Ode and I am facing the following problem, my routes are not loading in the browser. I’m new to nodejs, so it might be something I still don’t understand,…
javascript node.js web-application express back-endasked 3 years, 9 months ago Cláudio Vitor Dantas 11 -
0
votes1
answer33
viewsProblem with recovering the return of a Promisse
Before I was with a problem that when there was some error in the execution of the query the server stopped and had to restart to get back to work, so giving a search I found how to solve the…
-
0
votes0
answers9
viewsIs there any way to use EJS variables with the express "redirect" method instead of render?
Follow the example of an html page (index.ejs) with a message written "Password check" and a form with an input and a button. I want that, when filling this input with a password and making the…
-
0
votes0
answers26
viewsHeroku Nodejs "Cannot GET"
I made a CRUD with Nodejs, Express, Handlebars and Mongodb - Works great in development, but when I try to make the Deploy in Heroku from the continuous error "Cannot GET /". I’ve researched a lot…
-
0
votes0
answers14
viewsSequelize Error: Sequelizedatabaseerror
Hello, I am building my application on Node and using postgres database. I come across the following error: SequelizeDatabaseError: column \"zipcode\" of relation \"users\" does not exist" My model…
-
0
votes0
answers18
viewsError with Helmet on express
I’m trying to use Helmet, but every time I add it to the code I get this error: and jquery and bootstrap don’t work When I take out the Elmet the errors disappear Code: // Importações…
-
0
votes0
answers19
viewsHow do I receive route parameters in a controller in Typescript?
I have the simple routes.ts: import { Router } from 'express' import UserController from './controllers/UserController'; const routes = Router(); routes.get('/:User', UserController.index); export…
-
-1
votes1
answer152
viewsNode . /bin/www and nothing happens
I’m running a Rawler that I found on github, but it has no documentation, I created an Issue but I got no answer, and I’m very amateur, so maybe my doubt seems noobesca, but I would like help. Rodo…
-
-1
votes1
answer165
viewsWhat’s the secret for on the express?
I have an express application, but I do not know how important it is to set up secret in middleware session(). Could someone explain to me what secret does? What is the function?…
-
-1
votes1
answer573
viewsHow does an express session work?
I have a problem logging into my application. If a user logs in, they log in to everyone who visits the site. Could you explain to me how a session works so I can understand better?
-
-1
votes2
answers105
viewsHow could I see the variables of a local server running Node.js by "Inspect" the browser?
For a local HTML the global variables can be seen by the browser with Inspect, but I cannot see the variables running locally the same code with Node.js together with Express. I’d like to see the…