Questions tagged as 'node.js'

1
answer

NodeJS multiple url in app.get Express

I have several (almost all) urls that 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 that, also files that I request to my site an...
asked by 21.07.2018 / 15:18
1
answer

Nodejs - socket.io and jquery

Good afternoon I'm following the socket.io start tutorial and it's all working, but I do not understand why jquery only works if calling the script in html I tried to install by npm and it does not work (the message does not log in) I...
asked by 02.07.2018 / 17:40
2
answers

Electron crashing 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 system gets extremely slow for a few seconds un...
asked by 03.07.2018 / 07:24
1
answer

How important is .env in React?

I'm developing a website in React and I came across the .env file and it contains the following script NODE_PATH=./src for what would be its importance in React? Because my server only worked when I include this file in the project direct...
asked by 15.06.2018 / 15:59
1
answer

Multiple users on my NodeJS server accessing the same variable

I have a question about how a nodejs server works with multiple users. To contextualize: Let's say I create a variable on the server side, will the value of that variable be overwritten if someone else also accesses the same route at the same t...
asked by 01.05.2018 / 23:21
1
answer

How do I keep my Angular application running permanently?

To keep the NodeJs server running permanently on the computer is the following procedure; $ npm install forever $ forever start server.js However, how do I make my Angular application run permanently on my computer? If I restart my compu...
asked by 13.04.2018 / 12:09
1
answer

Combobox brings only one result of the Mysql table (NodeJS + JavaScript)

I am able to bring in only a value in the combobox that is in the table of mysql, I need to be listed both items in the same combobox. It is appearing one in a combobox and the other just below. <div class="container"> <% if(busca...
asked by 29.04.2018 / 19:32
1
answer

Update a query in installment form

Good afternoon, today a small question has arisen. Somewhere in my code I have a query to do an update. The function is as follows: function updateUser(user_id, params) { const query = 'UPDATE users SET user_name...
asked by 12.04.2018 / 18:30
1
answer

Multiple Prototypes

I would like to know how to add a prototype to a function that is already instantiated in a prototype. Example below: app.js 'use strict'; function NivFire(){ this.db = "", this.admin = "", this.reference; } NivFire.prototype = {...
asked by 21.04.2018 / 21:55
1
answer

Error. UnhandledPromiseRejectionWarning

In the browser, the following code works normally (how it should work): const get = async () => { return Promise.reject('Oops!'); }; get().then(console.log).catch(err => { throw new Error(err); }); But in NodeJs (version 8.10....
asked by 22.03.2018 / 01:40