Questions tagged as 'node.js'

1
answer

How to organize the REST API and the site frontend? [closed]

I am creating a Single Page Application, for this, I created a Restful API in Node.js that does all the actions in the database, login, sending emails and etc. I thought about creating a "public" folder in my project and put there my front end....
asked by 09.08.2016 / 01:49
1
answer

Compressing all NodeJs JS files (node_modules) decreases performance?

In my application I'm using Gulp to compress all my JS files that are inside the node_modules folder, my question is about performance, it's a bad practice to do this or not? If you have any suggestions, it will help a lot!     
asked by 09.09.2016 / 14:54
0
answers

Library pg vs pg-promise

In my project I used the pg library to access the postgres database. But with some needs, I used the pg-promise library. For those who have already used both, and understand more about the subject, I would like to know which is the...
asked by 04.08.2016 / 19:18
0
answers

Validate information in req

I get information for my route, where it is contained within req . Ex: router.post('/', function (req, res){ }); This information I will put in my database, however, before inserting, I have to check if all the information actually c...
asked by 05.08.2016 / 14:45
0
answers

External redirect in express

Galera, How do I change this line of code to my: app.use(express.static(__dirname + '/public')); For 1 external redirection, eg redirect to http://www.google.com     
asked by 19.08.2016 / 19:01
0
answers

Convert date format to another

I would like to convert this date format: Wed Jul 20 2016 17:55:00 GMT-0300 (BRT) for this format: 2016-07-20T14:55:00.000-03:00     
asked by 21.07.2016 / 14:15
0
answers

Generate graphics in image

Is there any api where I pass the data, and does it return the link of an image with the generated graph, in node js? I found this project: link , but it seems to be outdated, is it worth using?     
asked by 01.07.2016 / 15:56
1
answer

Doubt about NodeJS + Mongo application structure at Digital Ocean

I started by using 1 machine at Digital Ocean instead of UOL Host. As I do not have much experience with the server configuration part, I have 1 doubt and I hope someone helps me: Scenario: 1) My application is running on Digital Ocean o...
asked by 15.08.2016 / 19:28
0
answers

404 socket.io.js with express on node.js

I am creating a simple chat, which exchanges simultaneous messages between 2 browsers, using node.js with socket.io, but for some reason, my project can not identify my socket.io.js inside the project. And yes, I downloaded the socket.io. My...
asked by 28.06.2016 / 19:30
1
answer

Save image upload to directory

I am uploading an image using multer, I would like to know how to save this image to a specific directory, already with its original extension: .jpeg.     
asked by 20.06.2016 / 20:14