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
votes1
answer122
viewsHow do I delete cookies on Node.js when the user leaves the site?
I am setting a cookie in Node.js when the user chooses the language: res.cookie('lang', req.body.lang) But I wanted to delete the cookie when it closes the site, so that when it comes back the…
-
-1
votes1
answer29
viewsInclude return of a foreach within the background-image url
Speak guys, I need to include the return of a foreach within the url of a background-image, please can help me: <!-- Slide 1 --> <% DTSection0.forEach(function(row){ %> <div…
-
-1
votes1
answer54
viewsI cannot add a line to a table using db.run() in sqlite3
I have already installed Node Static, to fix the first time q error appeared, which seemed to be related to a server response delay, but msm after I took this delay, the error kept appearing,…
-
-1
votes2
answers35
viewsAccess static link on Node using authentication
In my backend I have this: app.use('/files', express.static('upload')) Generating static image and pdf links for users to access. In my frontend I put a button where the user can display the static…
-
-1
votes1
answer26
viewsI am unable to iterate the array
I would like to popular this array with the Category object I get when I query findById. But the variable loggedUserCategories appears as an empty array in Sponse , however, I can visualize the…
-
-1
votes1
answer109
viewsNodejs returns: Illegal Arguments: number
const bodyParser = require('body-parser'); const bcrypt = require('bcryptjs'); //Bring in User Model let User = require('../models/user'); var urlencodedParser = bodyParser.urlencoded({extended:…
-
-1
votes1
answer144
viewsWhat is the difference between REST API and CRUD?
I researching about REST API realized that it is very similar to the idea of CRUD, but did not understand the difference. For now I have the idea that REST API is a modern way of saying CRUD.
-
-1
votes1
answer7646
viewsRoute.get() requires a callback Function but got a [Object Undefined]
In an application nodejs I get this error message: Version: Date of publication: 8.9.2 npm: 5.5.1 express: 4.15.5 Error image: Code from the app.js /** * Module dependencies. */ var http =…
-
-1
votes1
answer29
viewsHow to format the date to the Brazilian standard in an attribute of type "DATEONLY" using sequelize?
I own a model with a date attribute of type DATEONLY, when I step into the body of the request 01/02/1999, and the return is "date": "1999-01-02". How can I format for the Brazilian standard? date:{…
-
-1
votes1
answer471
viewsProblems connecting Node.JS Express in Mysql
I know my project is correct that there is nothing wrong, I think the problem is my newly installed bank, how can I solve this problem? Unhandled rejection SequelizeConnectionError: Client does not…
-
-1
votes1
answer87
viewsError while creating user
I am having the following error when trying to create a user in my api Validationerror: address.0.status: Path estado is required. , Address.0.city: Path cidade is required. ,…
-
-1
votes1
answer364
viewsUnhandledpromiserejectionwarning: Error: Cannot enqueue Query after fatal error
I have this mistake and I couldn’t find any questions on Stackoverflow that would help me... the error is being generated provable because of a promise Index.js const path = require('path') const…
-
-1
votes1
answer1002
viewsHow to make a relationship with two items from the same table in Sequelize?
I have a table that holds two user Ids. The UserId and the ResponsibleId, both take from the table User. Model: module.exports = (sequelize, DataTypes) => { const Table = sequelize.define(…
-
-1
votes1
answer368
viewsSequelize foreign key error
Well, I was trying to implement the relationships with sequelize, I don’t know if I misunderstood the documentation but from what I understood it should work, below the model I want to make the…
-
-1
votes1
answer684
viewsQuery with conditions using Mongodb Irrigation + nodejs
I have a code that returns me arrays with the parameters I need to feed my HTML page, however, I need to include some conditions in this search so that it only takes the values after a certain date.…
-
-1
votes1
answer23
viewserror in authentication
Cannot read property 'username' of null Keeps giving this error I don’t know why, he can create a new user but can’t login, someone knows what is happening? app.post('/users', async (req, res) =>…
-
-1
votes1
answer658
viewsHow do I show the error message sent by Express?
I have the following method in back-end, who logs in: const login = async (req, resp) => { try { if (!req.body.id) throw 'Necessário Informar ID'; const ongFromDB = await…
-
-1
votes1
answer82
viewsShow button only from a specific <li> button
I am developing a web application where this green confirm button shown in the image, is only displayed when the blue edit button is clicked. These "cards" are li’s that are generated dynamically as…
-
-1
votes1
answer229
viewsUse more than one function in the Get Method route with Node.js
Good evening, I’m starting to learn about Ode and React.js and I’m having a problem because I need to use more than one function on the same route and by get method. I did the code below, it’s…
-
-1
votes2
answers626
viewsError while trying to display database data using Handlebars
Handlebars is returning this error to me every time I access the html page, it receives the values from the database but does not display. I’m using Mongo as a bank. Can you tell me if it’s some…
-
-1
votes1
answer61
viewsNode, Express and Graphql environment user system
Hello, world! I’m studying Graphql and I’m having a problem with this Mutation... var schema = buildSchema(' type userAccount { firstName: String! lastName: String! mobileNumber: String email:…
-
-1
votes1
answer894
viewsCannot POST express error
I’m trying to create a login system, follow my form: <form action="/auth" class="login-form" method="POST"> <h1>Login</h1> <div class="txtb"> <input type="text"…
-
-1
votes1
answer92
viewsFailed to open my server by Node.js
Today I had my first contact with Node.js and the sequence of the video lesson was like this: npm init -y // no terminal do visual studio (Criou o package.json que nem na vídeo aula) npm install…
-
-1
votes1
answer60
viewsHow to display text coming from mongodb (Mongoose) with line breaks correctly?
Good afternoon. I’m a beginner and am implementing a blog using Nodejs + Express + Mongodb (Mongoose). I realized that when I create a new post, the same one, when viewed, does not show line breaks…
-
-1
votes3
answers51
viewsHow to exit the condition loop in this register with Mongoose/Express
I was learning how to connect my API to a database using Mongodb, so I started learning how to register users and everything was going fine until I got caught up in a problem that’s keeping me from…
-
-1
votes1
answer84
viewsError loading image from server
Hi, I’m trying to upload the image that’s on my server directly to the interface. The server is nodejs with express, already on the front end I’m using the angular Sanitizer. On the server I have:…
-
-1
votes1
answer39
viewsVariables in JS Node
wanted to understand more the concept of variables in NODE. I tried to make a simple code to read a json from the internet. I created a variable to receive the name of the title, but after set, it…
-
-1
votes1
answer26
viewsproblems with routes in JS + handlebars (Referenceerror: home is not defined)
I’m learning Ode.js, but I’m getting too caught up in establishing the routes correctly. The structure of my folder is currently like this The code of the file server.js is thus found: const express…
-
-1
votes1
answer25
viewsHow can I avoid intermittent Cors errors with Axios and Vue.js requests?
I have an application developed in Vue.js that performs requests through Axios for an api developed in Node.js with express. My problem is that in 3% of requests CORS is blocked by locking the…
-
-1
votes1
answer24
viewsI can’t solve ERR_HTTP_HEADERS_SENT
My program points ERR_HTTP_HEADERS_SENT which by what I understand, occurs when a response has already been sent by the server. I’m trying to create a controller method of a route that changes some…
-
-1
votes1
answer33
viewsExpress sends the answer before you have all the information you need
I am trying to make a tool just for my personal use, it is a WHOIS/ DNS search tool, and I use the API of another site to do this. The URL I’m using to make the request is:…
-
-2
votes2
answers38
viewsDoubt: Expressjs no front-end framework?
Hello, good afternoon. I intend to be starting my project at Nodejs + Expressjs, but I don’t know this technology very well. Many people say that Express is only for API development and eventually…
-
-2
votes1
answer96
viewsNode.js with Vue.js
Node and vuejs can complement each other ? It is normal to use vuejs, Node.js and espressJS together ? In my view are 3 different frameworks, but it makes sense to use them together ?
-
-2
votes5
answers2360
viewsTypescript error Property 'user' does not exist on type 'Request<Paramsdictionary, any, any, Parsedqs>'
How can I fix the error Property 'user' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs> I created a @types folder at the root, inside it had a file express.d.ts with the…
-
-2
votes1
answer55
viewsHow do I "capture" the full route of an http call with express router?
I’m using the express.router nesting my route into several "router.use()". It is possible to take the final route via console? ex: const routes = Router(); const v1Router = Router(); const…
-
-2
votes1
answer43
viewsProblems with Mongoosis function (nodejs)
Hello, I’m having problems with a learning mini-api that I’m doing, I’m not an advanced user, but I’ve been dealing with Nodejs for a long time, I decided to create a mini-api without looking at…
-
-2
votes1
answer197
viewsServer does not update page after dynamic change
I generate a page through: app.get('/conteudo', (req, res) => { res.send(conteudojson); }). Dynamically, the conteudojson is amended and listed again the "/content": app.get('/conteudo', (req,…
-
-2
votes1
answer451
viewsMVC Web Standard with Nodejs
Guys, I’m not finding anything related, it’s as follows: I’m learning the MVC model, using the Express module (Nodejs), connection with Mysql Ok and already have a little interaction between the…
-
-2
votes1
answer176
viewsReal-time website with Node.JS
Come on, guys, can someone help me with this... I developed a fully dynamic website with Mysql database, that is, all the main elements of the main page are coming from the database, I do this using…
-
-2
votes2
answers152
viewsError loading CSS file, cannot find directory
I’m making a simple app, but I’m getting all confused in accessing the folders. I want to call the about.css file inside the layout.njk file. The directories I’ve tried none of worked. The structure…
-
-2
votes1
answer102
viewsBelongstomany Relationship - Sequelize
Hello, I have a problem in listing records with belongsToMany association using sequelize + nodejs. I have the tables Developers and Technologies. The relationship between them is Many to Many. To…
-
-2
votes1
answer563
viewsPopular Chart.JS with Mysql data passed in the page render by an async function
Speak people, I’m wanting to popular a pie chart on my Dashboard page, but I’m not getting, can help me (I don’t want to use php, only javascript, jquery and html). Chart: Chart.JS BD: Mysql…
-
-2
votes2
answers90
viewsMy localhost route:3000/files/ does not show the image ( express.Static does not return the image)
In my static file path, it finds the image but returns only its binary and not the image itself for the view. What I want is to be able to view the image when placing in the browser for example:…
-
-2
votes1
answer108
viewsUpload Multifiles with Multer , express , nodejs and query to Mysql
How to query the name of two different images for mysql? I’m using a woman to upload more than one image, and the code I used is working perfectly. The images are loaded into my briefcase imgpost.…
-
-2
votes2
answers27
viewsSQL command works on SQL SHELL, but does not work on Node (pg) (probably something related to accentuation)
DATABASE I have this database: In it I have this table: In it I have this data: NODE const express = require('express'); const app = express(); const cors = require('cors'); // cors config //…
-
-2
votes1
answer13
viewsSequelize returns error during api test
Good afternoon friends! I created a Rest api based on a youtube video using Node, express and sequelize. When sending an empty post, for one of the routes without access to the bank, I get return…
-
-3
votes1
answer101
viewsProblem with bodyParser - Does not take req.body even with bodyparser installed and configured
I’m trying to create my first REST MVC API with Nodejs and Express, only I can’t get the req.body information, bodyParser is configured. I’ve researched everything and I can’t find the problem,…
-
-3
votes1
answer24
viewsEquivalent of res.download express in restify
I would like to send a file to the browser to download In express I do so: app.get('/apk', (req, res) => { res.contentType('application/vnd.android.package-archive');…
-
-4
votes1
answer53
viewsIs it possible to consume an API with express?
I have a problem, I Wanted to create an API with express to consume Another API, but I don’t know how to do it ... Could you help me?
-
-4
votes1
answer69
viewsHow do I bring an HTML code stored in the Mysql database and print it on screen using MVC Express Node.js Project?
I want to print this code that is stored in the database in my project. And this is coming up instead of the code Here is the DAO providing the database information Here is the CONTROLLER that makes…