Questions tagged as 'node.js'

3
answers

What is this buffer when reading files in NODEJS?

I'm learning a bit of NodeJS . The last thing I learned was to read a file. The question that left me with doubt is the following. When I use the readFile function with the second parameter being utf8 , the reading of the f...
asked by 07.12.2015 / 16:51
3
answers

Application Node.js always falls after an error

I have an application in Node.js that whenever an error occurs it falls, having to be restarted manually, always. How do I get the error reported, but does the application continue to run?     
asked by 27.01.2015 / 15:48
1
answer

Receive array values from console

I'm starting the node studies and I decided to do an exercise in which I need to receive a value n through the node console, which will be the number of elements in an array and receive n elements through the node console. The problem is that I...
asked by 01.01.2019 / 23:17
1
answer

Problem removing all attributes of an object that contains null values

Context I'm inside an application in NodeJS, where I have a fairly large object that has several attributes and also attributes objects that have children, and I have a situation where I can not keep the attributes containing null values, so...
asked by 28.11.2018 / 23:26
1
answer

How to separate the errors of a query into an api expressjs

What is the correct method of separating errors from a query? The current code compares the error manually with the message generated by mysql, in case the query can go wrong for several reasons, instead of returning a log and error 500 like...
asked by 11.10.2018 / 21:12
1
answer

export json file

I'm using nodejs, mongoose. No controllers at the end I give res.json(clientes); and in my route I create: app.get('/clientesjson/:id', isLoggedIn, cliente.clientesjson); I need to access my Json information by ID. In the cu...
asked by 16.06.2015 / 22:28
1
answer

AdonisJS - Generate database code already created [closed]

I have a question. I would like to know if it is possible. I have a mysql server already running a template of mine, with tables already created and their fields. Is there a way to connect a Node project, Adonis, and take advantage of my Mysql t...
asked by 10.07.2018 / 03:29
1
answer

How do you declare date on Node Express?

I have the following entity; 'use strict' var mongoose = require('mongoose'); var Schema = mongoose.Schema; var ReviewsSchema = Schema({ name: String, date: String, rating: String, comments: String, restaurantId: String...
asked by 03.07.2018 / 14:12
1
answer

Make multiple requisitions or just one?

I'm doing an application in nodejs, where it is constantly necessary to consult information in the database, for example: name, description of items and etc ... A similar site would be netflix, which queries such information every time the user...
asked by 07.07.2018 / 18:56
1
answer

consume api rest with react and render the data in a table

My code: import React, { Component } from 'react' import axios from 'axios' import PageHeader from '../template/pageHeader' import cadastroForm from './cadastroForm' import cadastroList from './cadastroList' const URL = 'http://localhost:300...
asked by 04.05.2018 / 15:45