Questions tagged as 'node.js'

1
answer

How to deploy an application in local NodeJS?

Speak, all right? I've been searching the web but I was confused, I'm new to programming in node I made an application but I do not know how to do the local deploy as a service for example. Where can I start? is it possible to do that ? Thank...
asked by 21.07.2018 / 01:15
0
answers

Image upload with problem in nodejs

I'm running a test to implement an image upload and I've created the following code on the backend on node js. function uploadImagem (req, res) { var restauranteId = req.params.id; var file_name = 'No subido...'; if(req.files){...
asked by 08.08.2018 / 21:19
0
answers

Mocha + Chai do not access routes that need authentication

Talk to people, good afternoon. So, I'm doing some testing on my Node.js API using Mocha and chai, however I have a middleware that checks my user's token so he can get access to some HTTP requests. The login test works fine, but when I ha...
asked by 08.08.2018 / 22:08
0
answers

Sadia real-time Python script in html with nodejs and python-shell

I'm trying to make a server that asks the user for a data, uses it as an argument in a python script, and shows the real-time output for the user in the browser. I'm using python-shell to call the python script and pass the arguments. Until now...
asked by 19.07.2018 / 19:36
0
answers

Problem exporting function from node.js

I'm a beginner in node.js and I created an API that validates a CPF and returns a value of true or false, but I'm not able to send the return of that function to my other application. Here is the code: export defaul...
asked by 27.07.2018 / 16:32
0
answers

Adapt request with Express for AJAX

It is possible from a request using express, convert it to ajax, or even if you can merge them. Example: app.get('/alunos',(req,res) => { const client = new Client(); client.connect() .then(() => { return client.query('SELEC...
asked by 27.07.2018 / 04:38
0
answers

soket.io - doubt

I'm new to using soket.io and I'm learning how to create a server, but I'm not able to print the message, can someone help me? server.js var fs = require('fs') var http = require('http').createServer(handler) var io = require('socket.io')(h...
asked by 23.07.2018 / 22:33
1
answer

Can not display strings with line break in Node.js

I need to work with css in a js script for nodejs. However if the css has some line break the console.log does not work. const fs = require('fs'); var contents = fs.readFileSync('style.css').toString(); console.log(contents); However, I ta...
asked by 17.07.2018 / 08:37
0
answers

Data Persistence with Swagger

I need to use Swagger to send and receive JSONs. In addition, the API must do persistence and selection of data in a PostgreSQL database. I have already completed, in javascript the AJAX methods for sending and receiving JSONs, and the database...
asked by 25.07.2018 / 03:59
0
answers

Use JWT to authenticate API requests using typescript

Speak, then I have a problem, I apologize if this problem has been solved before, but I did not find the solution; In my API I can create my token and made a middleware route for my API token When I test in Postman everything is fin...
asked by 20.07.2018 / 19:13