Questions tagged as 'node.js'

0
answers

Javascript, return ajax request, generate file

newXHR.addEventListener('load', reqListener); newXHR.open('POST', 'http://nfse.vitoria.es.gov.br/aberto/op/imprimirNfe.cfm', false); var jsonData = { codNfe: vlNota }; var formattedJsonData = "codNfe=" + vlNota; newXHR.setRequestHead...
asked by 16.04.2018 / 16:08
0
answers

How do I assign the connection.query result to a global variable?

I'm learning to use the mysql module of the node and I came across a situation where I can not assign the result to a global variable, follow my code: let data = 0 connection.query(query, (err, rows, fields) => { if (err) {...
asked by 18.04.2018 / 16:13
0
answers

Make Schema field unique for a single field

I have a problem that I am breaking the head: I'm developing a REST API that uses MongoDB and I need Mongoose to not allow insertion via POST into the database fields that are not unique when linked to an ID. Example: {'_id': '1234', 'fi...
asked by 12.04.2018 / 21:54
0
answers

Adding elements to a mongodb database

With a problem, I'm trying to insert a new record in my database, where the entry is a {url: "example.com } I'm using the express framework, the mongodb database and the mongoose library (I've been able to do other things, add an id, delete an i...
asked by 15.04.2018 / 05:08
0
answers

My lightbox module that I inserted in the Angular does not work, how to do it?

Well I've installed this Lightbox module with the command npm install lightbox2 --save as per the site: lightbox until then. p> After I put the paths in the file angular-cli.json according to examples that I searched the net and looke...
asked by 13.04.2018 / 14:14
0
answers

file.mv is not working on Heroku

I'm doing an API with node.js for file transfer to a CDN however when running the function: file.mv(name, (error) => { It returns the following error: { "message": "Falha ao processar sua requisição", "data": { "errn...
asked by 11.09.2018 / 20:13
0
answers

RangerError: stack size exceeded because of very large directory

I'm developing an application with Angular.io and VideoJS I want to insert the VideoJS repository into a lib directory in my Angular project, to make development easier. The problem is that the Webpack of the Angular project can only c...
asked by 05.04.2018 / 20:52
0
answers

How to package the Node Express project?

I know how to package a project using restify in Node Express, because in projects using restify it is possible to allocate the application resources all in one file, just in the end give a nodemon and the file name, but not I can do the same wi...
asked by 18.06.2018 / 12:42
0
answers

Handle Transactions - Node, mysql

I am developing a POC where I need to register a sale. For this, I use this code: this.salvarVenda = function(connection, objeto, response, callback){ let sqlVenda = utilVenda.createSaveQuery(objeto); console.log(sqlVenda);...
asked by 30.03.2018 / 18:27
0
answers

Clean does not work

I'm having this following problem, "clean" does not work. (It only worked the first time, as I show in the picture) He is not erasing the folder, I would like to understand what is happening. Thank you "use strict"; module.exports = fun...
asked by 07.04.2018 / 02:40