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
-
2
votes0
answers888
viewsWhat are the main project standards in NODEJS for Web Development?
I am starting my studies in Nodejs and need to know what the main project standards for Web Development in Nodejs.
-
2
votes1
answer523
viewsHow to use other HTTP methods in HTML forms?
I’m using Express.JS to make a CRUD in Nodejs. I was trying to make use of the new HTTP methods, such as put , but when I put it in the attribute method of the apparently not certain form. The code…
-
2
votes3
answers887
viewsFIREBASE + NODEJS error: Firebase App named '[DEFAULT]' already exists
I have a CRUD made with NODEJS + EXPRESS, using FIREBASE. I add a record normally, but when I add the next one, it gives me the error: [DEFAULT]: Firebase: Firebase App named '[DEFAULT]' already…
-
2
votes0
answers437
viewsHow to handle errors in Mongoose optimally
I am starting to work with Mongodb + Mongoose and I am having problems dealing with the mistakes that Mongoose generates. One of the same is when there is a duplicate key for a parameter that should…
-
2
votes0
answers25
viewsAvoid route authentication late with JWT
The JWT allows us through the method unless inform Urls and request methods that no authentication should be required. But as far as I know it is necessary to do this when Middleware is informed to…
-
2
votes1
answer900
viewsUsing model.find() with LIKE in Mongoose
I have a function here to do a search on Mongodb using Mongoose, but I would like him to find Brazil when I searched for bra, Bra, Sil, Sil, etc. I looked in the documentation and followed the…
-
2
votes1
answer547
viewsReturn module.Exports values by Return
I have the following code that the data are returning right by console.log() var request = require("request"); var myJSON = require("JSON"); function resultado(url, callback) { request({ url: url,…
-
2
votes1
answer927
viewsRead row by row from file . txt
I am trying to read a file . txt from 3.5GB line to line and save to Mongo db. The columns use the "|" tab and I am using Node js with Express. I did the test with a file smaller than 43 lines and…
-
2
votes0
answers223
viewsHow to check if the EJS is rspondendo
My app is Ode with express and ejs 1 - It is running index.html and not index.ejs 2 I am unable to pass the title or title parameter to the view neither in ejs nor in html app.js and index.ejs are…
-
2
votes0
answers183
viewsConfiguration of Response Headers
I created an Express server and my client in Quasar/Vuejs. I need to send a PDF to my client, the PDF in question is already created on the server, but I am facing problems to send it to the client.…
-
2
votes1
answer556
viewsCorrupted PDF after download?
I am generating PDF’s of the data I have in a table in my client, send the data to the server and there is generated PDF. After it is ready, the PDF download takes place, and it is at this stage of…
-
2
votes1
answer1871
viewsUse delete method with express
Hello, I’m trying to send a value of a form (id) that will be handled by express (I don’t know the technical terms for this, if you can help me too), I’ve looked a lot but I can’t pass the id…
-
2
votes1
answer13414
viewsError: "Can’t set headers after they are sent" on Node.js / Express
I have the following method : //USER_POST router.post('/user', (req,res,next) =>{ var obj = {name:req.body.des_name, email:req.body.des_email, endereco:req.body.des_endereco,…
-
2
votes1
answer575
viewsHow do I display table data (HTML) from a database through JSON Express?
Hello! I would like to know a way to present to the user in an HTML table, data stored in a MYSQL Database with connection through JSON Express. const express = require('express'); const app =…
-
2
votes1
answer505
viewsPass variables on all renders
I have an application using Nodejs, Express (and a few more dependencies). I reduced the application to the file below to explain my question: app js.: // Dependências. const express =…
-
2
votes1
answer410
viewsNode.JS and Express Insert with problem
I am new as Node.JS Express programmer with Mysql, I created the implementation to save, but he create the registry with null in the table, see how I performed the test in Postman; This is my…
-
2
votes1
answer135
viewsNodejs: How to keep an updated list accessible between files
In a Nodejs application with Express/EJS, I need to keep an updated list and I would like that whenever the user accesses my root route, that is the INDEX page, he could see this updated list. To…
-
2
votes0
answers152
viewsCalling Javascript file using Express
I have a main.js file with routes to html files, but I would also like to add a route to a javascript file. In the main.js file I have the following code. const express = require("express"); const…
-
2
votes1
answer345
viewsWhy does the express session return 'Undefined'?
I’m having trouble recovering data from req.session. I have a sub-router that manages the main route and use a middleware to manage the session. I add the data I want to record in the session, but…
-
2
votes1
answer132
viewsFs.readFile dropping server
I’m using a server node.js with express and created an API to record content that arrived via POST in an archive .json. It does the process correctly to a certain extent: If the file does not exist,…
-
2
votes1
answer283
viewsres.render does not load . handlerbars within route - Node.JS and Handlerbars
Good night! I’m learning Node.JS and I’m stuck on the routes. I have the following codes. //app.js // carregando modulos const express = require('express') const handlebars =…
-
2
votes1
answer536
viewsHow do I set a default value for a column in Sequelize?
I am using Sequelize (v5.0+) with Nodejs (with Express). I want that for the column status in my database has the default value (defaultValue) as true. Migration module.exports = { up:…
-
2
votes0
answers218
viewsUse a Controller to connect routes with asynchronous functions [Node]
Good night! I’m having doubts about something that seems easy, but I’m not getting out of place. The idea would be to utilize the GET method to recover users from the database, but would like to use…
-
2
votes2
answers122
viewsarray.push() inside mysql.query callback (nodejs)
Hello, I am having a problem adding a custom error in an array of errors, in the validation of a form with nodejs. I’ve tried to change my approach but I haven’t found a solution, //PARTE 1 let…
-
2
votes1
answer43
viewsProblem with running order of endpoints in Express with conflicting paths
I have this question about endpoints express bred. In this first section, the endpoint /anuncios/:search must search in the fields descricao and nome by the text reported. Therefore, a call…
-
2
votes1
answer62
viewsfindByIdAndUpdate() is creating document instead of updating
I am crud using Node, Express and Mongodb, but I have a problem with the update operation when using the findByIdAndUpdate() Mongoose it is not updating the document but creating a new.…
-
1
votes1
answer765
viewsUpload multiple files with Node.js
I’m trying to upload multiple files with Node.js, but I can’t do the server part. I am using Expressjs as a framework, and if necessary I can use other packages to facilitate this task. For now, I’m…
node.js upload file-upload express multiple-file-uploadasked 10 years, 7 months ago André Leria 5,047 -
1
votes1
answer396
viewsHow to edit page after rendered with Node.js?
I need every time a page with a path is rendered to be added a paragraph after the <body> and another paragraph before the </body>. I’m using Express.js and da to do this by picking up…
-
1
votes1
answer167
viewsError sharing HTTP Session with socket.io. io.sets "is not Valid".
I am applying the step by step book "Node.js, real-time applications" of Caio Ribeiro Pereira. All right until the part about sharing the HTTP express-Session to the socket.io. As far as I can see…
-
1
votes0
answers194
viewsHow to host server on local router with Express.js on Mac OS X?
Since I started using Mac I am no longer able to host a local server on my router with Express. In Ubuntu just pass the router IP as second argument of app.listen and everything worked out: thus.…
-
1
votes1
answer366
viewsexport json file
I’m using nodejs, Mongoose. No controllers at the end give a res.json(clientes); and on my route I create: app.get('/clientesjson/:id', isLoggedIn, cliente.clientesjson); I need to access my Json…
-
1
votes1
answer682
viewsNode.js - Take URL parameter via Jade
I have the following url http://localhost:3000/user/index/1, would like to get the last parameter. I tried with - var name = window.location.pathname; put in the file . jade and did not work, but if…
-
1
votes1
answer1283
viewsSum of Nodejs + Mongoose values
I need to sum the values stored in a variable in the bank. I have a form and want to know the total value generated in a variable. So I did it this way: _.each(cliente.data, function (data) {…
-
1
votes0
answers117
viewsBad Request when logging in with Passport, Express and Nodejs
I am trying to authenticate a system but whenever I try to login (post) I get an error: 400 (bad request). On the console appears the message: The Character encoding of the Plain text Document was…
-
1
votes2
answers250
viewsSum number of records per year and month
I need to generate a Json file that will feed a graph. I need to load the following information. I have a form that receives date(dd/mm/yyyy). My chart shows the number of registered visits per year…
-
1
votes1
answer43
viewsUse of filter in ng-repeat in jade templates
Guys I think I’m doing something wrong but I’m not finding the error in the code. ul(class='list-group') li(class="list-group-item", ng-repeat="v in votadas | filter: '-votos'") h4 Música: {{…
-
1
votes0
answers1095
viewsHow to redirect to a js Node page?
I can do this more with a route, but I want to do something like: app.redirect(url); and not: app.get('/', function(req, res) { res.redirect(url); }); someone can help me? vlw , and obgd!…
javascript node.js redirecting express url-forwardingasked 8 years, 10 months ago Henrique.Araujo 105 -
1
votes0
answers96
viewsMean Stack Running the first project
Good afternoon guys, I’m trying to run the Mean stack on my machine (Ubuntu 14.04, 64bits), I followed the step by step site and apparently everything went well when I run the cameo on the ternimal…
-
1
votes1
answer245
viewsHow to include a regex in the parameters of an Express route?
In a project I’m doing I want to point a specific route to a controller. In a simple case of a route with parameters I would do so: app.get('/:lang/:activities/:activity',…
-
1
votes0
answers307
viewsWrite image file with nodejs
I get an image in image:data format and need to save it as an image on the server, I tried: var imageData = req.body.imagem.replace(/^data:image\/png;base64,/, ""); fs.writeFile(url, imageData,…
-
1
votes1
answer1094
viewsRoute configuration error in Nodejs with Express
I’m having a problem starting Nodejs, similar to this other post at this link, but had no more feedback from those who asked and the solution presented in the reply did not suit me either. The…
-
1
votes1
answer3765
viewsGet information from a url using Node + express + ejs
I set up a url in the following format: localhost:8080/forgetPassword/id/hash I have this route rendering: app.get('/forgetPassword', function(req, res) { res.render('pages/forgetPassword'); }); So…
-
1
votes1
answer184
viewsCompare multiple arrays
I have two arrays, being them: data [ 0{ nome: a numero: 2 } 1{ nome: b numero: 3 } 2{ nome: b numero: 3 } 3{ nome: b numero: 8 } ] dataNota[ 0{ nf: 9999 numero: 2 } 1{ nf: 2000 numero: 3 } 2{ nf:…
-
1
votes2
answers231
viewsDoubts with Node.js - Error: route.js:162
I am facing problems running my application. I performed the correct mapping, according to the book in which I am learning (MEAN stack Code House). express.js file // config/express.js var express =…
-
1
votes1
answer138
viewsHow to handle my app routes with Express
Guys, I’m using a framework for the front of my app. He keeps listening and whenever you click on a link he returns the page via Ajax request. Note: I am using Angularjs. With Angular I can treat…
-
1
votes1
answer245
viewsbeforeupdate sequelize does not work
I am trying to make the data update encrypted the user password but simply does not work and does not issue error. Have the following model of sequelize. import bcrypt from 'bcrypt'; export default…
-
1
votes0
answers49
viewsManage files on the server?
I am making a server using Nodejs and Express and in it I am generating pdfs of reports. How do I manage these files, and when I talk about managing I mean having options like opening the pdf,…
-
1
votes1
answer720
viewsReact-router not rendering pages not found correctly
I’m developing an application using React + React-router + Express to render to the server and injecting it into an EJS view. It is working properly, but I noticed that when not finding a route as…
-
1
votes1
answer193
viewsSetting default values for variable with Pug Template Engine
I am starting to work with MEAN and use as template engine Pug. I know that the same was Jade before and that there were updates on how to work with the same. My problem is that, in Jade, and in…
-
1
votes1
answer520
viewsHow to run an Angular application with Node.JS and Express
How do I link an angled login application with the Node.JS and Express server. How do I test (pull) the application to the server. The server is running normally on port 3000: var express =…