Questions tagged as 'node.js'

0
answers

Manage 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 to manage I mean having options like opening the pdf, downloading it and printing it. I am using the pdfMake li...
asked by 31.07.2017 / 14:28
0
answers

Serve custom .js file on Express route

I have a home page for authenticated user that is served by router however this authentication is done via cookie if there is this cookie of "session" (created after user login and defined his path to root) any request other...
asked by 18.07.2017 / 03:26
0
answers

Return a variable (Singleton) using Node that depends on Promise

Good afternoon guys, How can I create a variable in NodeJS / JS where I would return a value only to be used multiple times throughout the program? Exemplifying my problem: I have to log in to a platform and then send data to it. When I l...
asked by 12.07.2017 / 21:05
0
answers

Node.js passport.authenticate is not a function, how do I solve this?

As requested, I narrowed down the codes a little and kept only the essentials that I believe were involved with the problem. Reformulating my question: I have a simple register in a modal (only name, email, phone and password) I can navigate the...
asked by 13.07.2017 / 21:11
2
answers

MySQL with NodeJS: insertion of records

I created a script called 'test.js' just to demonstrate a simple insertion of log records into a MySQL database, using NodeJS, as below. I will generate something around 5 logs per second, which makes me assume that it will require a certain pro...
asked by 17.07.2017 / 20:53
0
answers

Postfix for server nodejs with ionic error XMLHttpRequest

I am using ionic 3 to execute a http post request for a local server developed in node js but the error is occurring:    VM1515? ionicplatform = android: 1 XMLHttpRequest can not load link . Response to preflight request...
asked by 17.06.2017 / 17:57
1
answer

bodyParser is not defined error in Node.js

I'm trying to create an HTTP server where it will use bodyParser() to request the middleware part before the handlers . But when trying to use it in code, it indicates error saying that it is not defined. My code: var ht...
asked by 11.06.2017 / 19:03
1
answer

Error socket.io Node.js

The intention with the program is that when two clients connect they display in the window of one client the id of the other. The program saves the two ids in the variables but sends only to the first user who logged in. The second logged-on use...
asked by 23.06.2017 / 05:35
0
answers

Sharing routes on express

I'm trying to make a generic controller that will provide the basic crud routes, the idea is to extend this controller and be able to add some custom routes that are inherent only to that class. Here's an example: export default class B...
asked by 03.07.2017 / 17:26
1
answer

Return values from module.exports by return

I have the following code that the data is returning right by console.log() var request = require("request"); var myJSON = require("JSON"); function resultado(url, callback) { request({ url: url, json: true }, f...
asked by 01.06.2017 / 18:41