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
answers662
viewsModel, Express and the Mongoose
I have the following code in express.js const express = require('express'); const load = require('express-load'); module.exports = () => { var app = express(); var bodyParser =…
-
0
votes1
answer72
viewsNodejs file is undefined
Hail to the people! Try to help me please, I am new in Nodejs and express and I am not able to get input file in my ejs, when I send to the route already arrives as Undefined. File server.js var…
-
0
votes0
answers2
viewsexpress nodejs send several files via send file
as I send 2 files to the site by sendFile , I’ve been trying to do this all day and trying to find a post that helps me and found nothing //ms.pipe(requisicao, resposta,[__dirname +…
-
0
votes0
answers256
viewsNo 'Access-Control-Allow-Origin' header is present on the requested Resource. - MEAN STACK
Hello! I need to pass a string to Node and am receiving the following response in the browser console: Failed to load http://localhost:3003/api/buscarCep: No 'Access-Control-Allow-Origin' header is…
-
0
votes1
answer60
viewsAccess one module from another
Well, I’m learning how to implement MVC with the Express framework, but I came across the following situation in my app.js file: var express = require('express'); var consign = require('consign');…
-
0
votes0
answers351
viewsError when viewing API in Angular
Good morning, I’m trying to access my API through the angular method get of the http module, my files are in my repository github in case anyone wants to take a look. I am following this tutorial…
-
0
votes1
answer109
viewsNodejs multiple url in app.get Express
I have several (practically all) urls, which point to a single page and use the following line to send the file: app.get('*', function(req, res){ res.sendFile(__dirname+'/home.html'); }); But with…
-
0
votes2
answers1529
viewsHow to set up an SSL certificate for an application that runs on Express?
How to set up an SSL certificate for an application that runs on Express? I’m trying to set up the Express server I created, to pass the SSL certificate and go from http to https. I read the Express…
-
0
votes0
answers227
viewsGenerate chart using Chartjs in Express
I am trying to render a chart using Chartjs. I am using nodejs (Express) and mongoDB. The idea is to take the database data, go to the front, and from that, render the graph. I already have some…
-
0
votes1
answer192
viewsGenerate an array from a query in mongoDB (Mongoose)
Good morning! I need the data from a collection of Mongo on the front end. I’m using Mongoose as ODM, and I got a little lost in sending the data to the front end. In the query it returns me the…
-
0
votes1
answer243
viewsExpress and Express Generator
I understood that the express Generator only creates Boilerplate for the project. But I didn’t understand very well which is the correct way to add it to the project I need to install the 2, or only…
-
0
votes1
answer200
viewsproblem sending values from one route to another
I am making a login system with mysql I am unable to pass the route values to another i want to go from login router to users router the code is followed connection.query('SELECT * FROM users WHERE…
-
0
votes1
answer123
views -
0
votes0
answers150
viewserror and server nodejs after 2 minutes
Good evening guys I have a basic program that until yesterday was good, today afternoon started the error in the execution of the "app nodemon" or only the "app Node" follows the error: throw er //…
-
0
votes1
answer44
viewsreturn to view that fired the form in case of any error! Nojde+Express
Good morning guys, it looks simple but I haven’t been able to on my own and I haven’t found it on the net, I just wanted to return to view that fired Submit, I have a simple registration screen...…
-
0
votes1
answer54
viewsProblems with Node + express routers
I have a sequence of methods (get, post, put, delete), however the put method is wrong and I do not know how to solve. this is the code snippet: router.route('/') .get((req, res) =>…
-
0
votes1
answer70
viewsError while escaping an express js url from a middleware
I’m having a problem escaping a Url of the validation of Token. I’m using the lib jwt (jsonwebtoken) to restrict accesses to my api request, but I want to leave the url /imagem/:parametro without…
-
0
votes2
answers395
viewsMongoose findone do not return values
Guys, I’m having a problem here that I don’t know what else to try, I’m using express + Mongoose. My model let mongoose = require('mongoose'); let users = mongoose.Schema({}, {strict: true});…
-
0
votes1
answer1437
viewsNODE.JS - Error: Route.get() requires a callback Function but got a [Object Undefined]
In my roters I create: var express = require('express'); var router = express.Router(); var service = require('./../services/users'); router.get('/login', service.login); router.get('/register',…
-
0
votes0
answers186
viewsHow to change the connection to the database using Sequelize+Mysql+Express depending on the parameter sent in the request?
For example, when receiving a request parameter equal to db1, in the precise controller that uses the db1 connection string When starting the Nodejs server the configuration made in the config.json…
-
0
votes1
answer22
views"Typeerror: Crud.Select_products is not a Function", I’m getting this error when trying to access a method from an exported class in Nodejs
File server.js var express = require('express'); var Crud = require('./database/Crud'); var app = express(); app.get('/api/home', function(req, res){ let results = Crud.Select_products();…
-
0
votes1
answer161
viewsThe server does not return any response when accessing the route
[SOLUTION] It was necessary for me to configure the Postman Authorization tab and select the Type Bearer Token option and pass the token When trying to access a route in my API using the POST method…
-
0
votes0
answers21
viewsProxyapi Nodejs (Upload of files)
Good afternoon, I am creating a Proxy for an application. What is intended is to centralize a set of API’s and forward requests. I’m doing a basic example in nodejs. Where I have 2 servers: Server 1…
-
0
votes0
answers119
viewsSession does not persist using express-Session and Passport.js
When logging in, my user is redirected to another router, only the session is not saved: router.post('/login', passport.authenticate('delegados', { failureRedirect: '/login', failureFlash: true }),…
-
0
votes2
answers1371
viewsHow to receive express headers sent by Xios in React.js
My front sends requests with Axios to Node express API this way: class ServiceRequest { constructor() { this.api = axios.create({ baseURL: URL_BASE, timeout: 1000, headers: { 'Content-Type':…
-
0
votes0
answers278
viewsNodejs Express Sessions problem: all information is being exchanged
I need help fast ... I’m wondering why my web application (Nodejs 10.x) is giving this strange error: It’s swapping out user sessions... When a user edits their profile, the information always goes…
-
0
votes0
answers26
viewsPopulating select with data sent from controller and trying to save to BD
I am sending to form an array to popular select so, controller that sends to the view: const novaForm = async ({ Maquina }, req, res) => { const maquina = await Maquina.find({status: 'livre'})…
-
0
votes1
answer234
viewstake data in the method post
I’m sending an angular object, but I’m not getting the data on the express Node method sent with angular. this.appService.getcheckout(this.post()).subscribe(checkout => { this.log = this.log+…
-
0
votes0
answers128
viewsError while doing query
I am building a Rest api with Node, but when trying to get a pass parameters returns all the data. app js. const express = require('express'); const app = express(); const mongoose =…
-
0
votes1
answer452
viewsUse proxy in nodejs to access external files
I have a service on Nodejs that does a fetch to access an external api: const express = require('express'); const middlewares = require('./middlewares/middlewares'); const routes =…
-
0
votes1
answer134
viewsI cannot access SQL query property on Node.js
I’m trying to create a code that logs into a website, but when it takes the data from the database to do a check, I get an error. My current code: router.post('/loginClin', function(req, res, next)…
-
0
votes1
answer115
viewsProblem Bringing Database Data to html
hello people I am doing a school project and would like a help in this part, here should happen the following, when the customer select the attendant in select Service should be listed the services…
-
0
votes1
answer54
viewsSearch and add table data in form [Nodejs and Mongodb]
I’m trying to load data from 3 tables into a form from routa, but it only takes the data from Municipality in the select of Country. It is supposed to have 3 selects (Country; Country; Municipality)…
-
0
votes0
answers552
viewsCross-Origin Request works on Postman, but not on frontend
I need to access my API for sending emails, but every time I try to do it through my application’s frontend I get a CORS error saying Cross-Origin Request Blocked: The Same Origin Policy disallows…
-
0
votes2
answers150
viewsv-form post does not send data
I created a basic form to see if I receive data in my API using vuetify but when giving Ubmit the v-select data is not sent and I cannot understand the reason, since in general the examples of these…
-
0
votes1
answer163
viewsHTML does not pull CSS generated by SASS
I’m using express to upload the server and Gulp to generate Sass, Gulp generates the file correctly, but the css is not adopted by HTML. follows code : Express : const express = require('express')…
-
0
votes1
answer55
viewsProblem in the Result
I am having problems both to present the error message and to insert the information in the BD module - express-Validator 1 - Error in saving information: Result { Formatter: [Function: Formatter],…
-
0
votes1
answer42
viewsServer Express does not read file beyond index.html
I created a server with express: const express = require('express'); const path = require('path'); const app = express(); app.use('/static', express.static('public')); app.get('/', function (req,…
-
0
votes1
answer481
viewsExpress Validator in controller
Hello. I use the Validator express in the nodejs and I’m having a validation problem. When I was validating directly through the routes, the validation was working, however, when I implemented…
-
0
votes1
answer126
viewsPromises.all are on an infinite loop
I have the following code segment: generateEpisode(result,programId).then((arrayBlocks) =>{ const promises = [] arrayBlocks.map((file,index) =>{ promises.push(normalizeFile(file,index)) });…
-
0
votes1
answer94
viewsHow popular are multiple <select> "with distinct results" in a single app.get() route?
Still beginner in Nodejs and working with Express, Handlebars and Mysql. In a form - which in the future will be a register, this has among other inputs, two <select> any, one must be filled…
-
0
votes1
answer278
viewsMongodb - Add documents that have a certain value within an array
Hello, thank you for your attention. If I have left any questions, please let me know. I found a problem that is driving me crazy. I have the following collection: { "_id":…
-
0
votes1
answer111
viewsHow can I make my Ode application available in many languages?
Hello, I have a Ode application that uses express and handlebars, I would like to make it available in 3 different languages (Portuguese, Spanish and English). I managed to do this by creating a…
-
0
votes1
answer370
viewsWhen to close a postgres pool at Nodejs?
I’m with a Nodejs application that basically has a food search engine. However always in the second research occurs the following exception and I do not know in what part of the code exactly I…
-
0
votes0
answers27
viewsHow to recover an idUsuario(user_id) from an idAnuncio(ad_id) models by Discount(Discount) Discounts? REST API
I need to do a query to recover a User’s discounts(idUsuario = user_id) by the Discount models' numbers, however, discount is only related to an idAnuncio(ad_id), so it’s like recovering an id via…
-
0
votes1
answer29
viewsProblem with MYSQL data formatting
I am making a hotel management system using Javascript, Nodejs, Express and MYSQL. I need my date format to be DAY/MONTH/YEAR, this way: DATE_FORMAT(dt_entrada, '%d/%m/%Y') DATE_FORMAT(dt_saida,…
-
0
votes1
answer552
viewsCalling a javascript function in ejs files
I am trying to create in my js file a function to format a date by changing "-" to "/" and I am using Node.js and express as follows. function formatDate(str){ var format =…
-
0
votes0
answers251
viewsNodejs, Express + Swagger
Hello, folks I was tasked with a mission to implement Swagger in an express application, with the purpose of generating Swagger.json for the AWS apigateway deploy. I have tried using swaggerJSDoc,…
-
0
votes1
answer196
viewsHow to serve a frontend in Vue.js/Vue-cli on the local network and use it for workstations that have no internet connection?
I need to develop a web application with the following scenario: Server: hosts the application, has internet connection to communicate with Apis; Stations: restricted machines, no internet…
-
0
votes1
answer30
viewsmy express server does not find the Javascripts and style files contained in html
hello guys I am beginner in the area, this and my prblema: My express server does not find the Java and style files contained in html this is my code: APP.JS const express = require('express') const…
expressasked 5 years ago denilson moraes 1