Most voted "node.js" questions
Node.js (or commonly Node) is a Javascript Runtime created with Chrome’s Javascript V8 engine. It allows you to run Javascript code without the need for a browser, raising the privileges to those found in other desktop languages. It is a technology strongly focused on non-blocking programming of I/O operations, which makes it very efficient for these operations.
Learn more…2,679 questions
Sort by count of
-
0
votes1
answer397
viewshow to render a JSON in reactJS
am starting to learn React and want to connect with a server nodejs he’s returning a JSON [{nome:"joão",sobre:"victor"}] then in React: class Page extends React.Component{ constructor(props){…
-
0
votes1
answer2310
viewsUpdate data automatically without refreshing the page
Maybe this doubt is quite "beast", but I’ve tried several ways and I’m not succeeding. I have a page that counts a quantity of products, but I need the data presented through the query that is on…
-
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
answers26
viewsPage with parameter not rendering CSS
Hi, I have a problem rendering my page. When I do a route with parameter in the URL the bootstrap css simply does not render, however, if I do a route that does not have any parameter in the url the…
-
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
votes2
answers474
viewsRestful implementation of express routes do not work on the server
I have a Restful API implemented in Nodejs working normally locally, with all routes responding, all right. However, when putting into production on the Kinghost server only the root route works. I…
-
0
votes0
answers241
viewsHow to recover the tragos data in the api query in NODEJS
Good morning Galera. I am consuming an external api and am receiving the data as follows: { "place_id": "151508663", "licence": "Data © OpenStreetMap contributors, ODbL 1.0.…
-
0
votes0
answers67
viewsChanging the value of a variable within a nodejs function
userFoundId = undefined; const result = connection.query('SELECT id FROM users WHERE name = :name and password = :password', data, (err, result) => { userFoundId = result[0].id //Valor alterado…
node.jsasked 4 years, 8 months ago Yuri Henrique 11 -
0
votes2
answers92
viewsConnection between Node and Postgresql
I am creating a Node API for a personal project with Postgresql connection. Is there any way to migrate (so that records are automatically created in the database) from created models? I know how…
-
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
answers89
viewsreturn object returned from bank to front-end
I don’t understand why you return On the Node.js server: //Insert user router.post('/', async function(request, response) { let object = { name: request.body.userName, password:…
-
0
votes1
answer801
viewsPush notification with Socket.io
I made a small application with Node + socket.io to send notification. adding the code below on the client page, the notification is displayed in the div "messagebox". <script…
-
0
votes1
answer62
viewsHow to export the contents of a promisse that is in a module to another module?
I have the following module getToken.js: var rp = require('request-promise'); const options = { url: 'https://meuservidor:8080/nifi-api/access/token', method: 'POST', gzip: true, rejectUnauthorized:…
-
0
votes1
answer60
viewsAutoload models in Mongoose
I have an API in Nodejs where I created a file to be my datasource, in this file I autoload my models by reading the files of my app and for each matter in the sequelize. The code is this: import…
-
0
votes2
answers721
viewsMysql sequelize error in Docker
I can’t connect the mysql api to Docker, but I can run mysql on Docker from the terminal index js. const db = require('../config/database'); const sequelize = new Sequelize(db) module.exports =…
-
0
votes2
answers92
viewsMy Node js API mixes data from different requests
I developed a private app on Zapier.com. The framework is in Node js. And it is composed of triggers and actions. In one of my actions, when it is desplotted several triggers simultaneously I get…
-
0
votes1
answer106
viewsScript with Node.js not generating output
Hello! I started to solve problems of the Urionlinejudge platform and in the first challenge I already had doubts about the solution with Node.js. The problem only asks to insert two integers (one…
-
0
votes1
answer289
viewsError while updating Node.js in Windos 10 64 bits
I had Node.js 5x installed and I downloaded and started the installation of Node.js 8x and Wizard did not install and reverse the entire operation and now I do not have Node.js and npm installed. My…
node.jsasked 6 years, 3 months ago Adriano Frota 121 -
0
votes0
answers286
viewsPassing data via post HTML JAVASCRIPT
Hello, I am doing a college job, an academic control, and when trying to remove a tuple from the database by passing the "id" of the tuple via post form, the value arrives either empty or Undefined.…
-
0
votes0
answers70
viewsNode return page
I have the following code pad server.get('/energy', (req, res, next) => { { const getScript = (url) => { return new Promise((resolve, reject) => { const http = require('http'), https =…
-
0
votes0
answers34
viewsDoubt in loading the Rest acquisition to the view
I’m following a video lesson and a question has arisen. created two folders one for the front (which is run by http-server port 8080) second folder to the back ( which is run by the port 3000…
-
0
votes0
answers44
viewsSend a data to the database with Node js
I am creating a REST API, but with difficulty in sending a data to the database using 3 modules, let me show my code rotaCliente.js on this route I receive a json with email,name,password and Cpf…
-
0
votes1
answer40
viewsNodejs ignores request POST made by Angular
Context: I’m using a virtual machine , ng serve is running on port 4200, and the nodejs on port 8024, when I try to send data to the server nothing happens, the angular part apparently shows no…
-
0
votes1
answer722
viewsNPM - modules and proxy
Good afternoon I am trying to install the ibm Watson module in my app, but get error below I am in the company network... What I wanted to know is if I can "dribble" or configure this proxy somehow…
-
0
votes2
answers205
viewsElectron locking when opening more than one application
I’m going through a little problem :c Whenever I open more than one Electron application and it starts loading a new main window for the user to start using the application, the entire operating…
-
0
votes1
answer206
viewsClick on a button and get the values of a table’s row
I’m doing a project in nodejs / javascript and I’m trying to get the values that are in a table row. By clicking on the button that this line will fetch me these values and will send them to another…
-
0
votes1
answer479
viewsHow to copy multiple files from one folder to another using Fs.copy
I wonder how I do to copy more than one file to another location (folder). Using the fs.Copyfilesync. In the example I can only copy one file: Example: fs.copyFileSync('C:/xmlpath/file.xml',…
-
0
votes1
answer323
viewsSearch for record in another table with mysql and sequelize
How to search the column record nome on the table categoria, for id that was saved in the table postagens? const db = require('./db') const Post = db.sequelize.define('postagens', { titulo: { type:…
-
0
votes1
answer406
viewsUpload File Nodejs
I’m breaking my head here to try to upload images with Nodejs but it’s being "Freud". I am developing an api where you will have access from three domains. So the structure of my api is basically:…
-
0
votes1
answer42
viewsNode Express get problem
I’m trying to list the menu record in my Mongodb database and am not succeeding, but when I list the Restaurant records I succeed, all two collections are in the same database, why is this…
-
0
votes2
answers152
viewsNode with mongodb not starting application
I’m trying to raise an application in Node with mongoose, (I am studying, MEAN book code house) and generates me the following error while trying to start the file server.js where I start my…
-
0
votes1
answer335
viewsHow to use async and await in Nodejs
I am trying to learn how to use async await but, I am missing something and I need help. My method works as expected with Promise see: import express from 'express'; import conn from…
-
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
answers2968
viewsStore Promise output in a variable
How can I store the result of Promise in a variable? Promise returns the result of a database query. function consultaMarcas(){ return new Promise(function(resolve, reject) {…
-
0
votes1
answer98
viewsUsing`await` out of asynchronous function causes syntax error
I’m trying to make a function that awaits the answer, but the console points out an error: var cota = await getJSON(); ^^^^^ SyntaxError: await is only valid in async function My code is: async…
-
0
votes0
answers30
viewsWebsocket Server - Error in the npm server.js command
I tried to execute the command npm server.js and he turns me into that mistake: Error: System EADDRINUSE ::3000 At object. _errnoException (util.js:992:11) at _exceptionWithHostPort…
-
0
votes0
answers38
viewsReturn data from another
I have the following problem, create the user and add the same in a course. Only I can’t return the course name on the user page. The course is added via select input, sending only the course ID.…
-
0
votes0
answers40
viewsMysql Read HTTP URL
I would like mysql to read a url through a SELECT I searched and saw that you have an answer here. I did the whole procedure as it is in this link, but to no avail select would call the url as in…
-
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
answers90
viewsProblem when exporting Node.js function
I am a beginner in Node.js and I created an API that validates a CPF and returns a value true or false, but I am not able to send the return of this function to my other application. Follows code:…
-
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
answer881
viewsGet attribute inside an array in Mongodb
Hello, friends. Good evening! I’m having a problem developing an api, I need to query some attributes within an array of a Schema in Mongodb to add them to an email for an order. Could someone help…
-
0
votes1
answer450
viewsCORB/CORS error when requesting google api
I have an Ionic-angular project with server developed in nodejs. I’m trying to do a user authentication by sending a request to the google api through the framework Passport using the…
-
0
votes1
answer490
viewsreturns data with module.Exports Node js
I’m having trouble returning data using module.Xports, here’s an example of how I’m trying to do it module.exports.menu = (app,req,res)=>{ var fs = require('fs'); var patch = 'public/menu'; var…
-
0
votes1
answer46
viewsSubroutes in Node JS
I have the following doubt. I have two GET routes, and the second route, whenever I try to access, the browser understands as if I were informing the parameter :id and creates an error.…
-
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
answer1101
viewsConnection being refused
Following this tutorial of Vedovelli about Ode with restify and mysql, I implemented on the server with pm2. Only after a few days the connection began to be refused Is showing that message: errno:…
-
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
answer102
viewsTo insert a value passed by parameter in the sql query
I am passing two values of an input to the function "Insert", the values then arriving at the function normally, I am printing them to confirm, but still I can not insert the values passed in the…
-
0
votes1
answer24
viewsRe-use method
I made a query to search a user. It worked! But I tried to make another appointment, he gave this message Error: Cannot use a pool after calling end on the pool 'Cause every time I make a…