Questions tagged as 'node.js'

1
answer

Run a shell script with NodeJS

I need to create a page using nodejs, which will contain an "on / off" button. When I press this button I want to call the same route, but pass a parameter: on / off or 0/1, etc. When making this call, I will treat the received parameter and the...
asked by 18.07.2017 / 04:06
1
answer

Retrieve HTML text from the MySQL database with EJS (Node.js)

I'm developing a news portal on Node.js where I save posts to a MySQL database. As a template engine, I use EJS. I use the Tinymce plugin to format the text of the posts (use bold, italic and etc). Tinymce is a visual editor for robust Intern...
asked by 28.05.2017 / 16:29
1
answer

Error starting project nodejs + Sequelize + mysql

When I try to start my project, it gives the following error: D:\www\nodejs\master>node bin/www module.js:472 throw err; ^ Error: Cannot find module 'sequelize' at Function.Module._resolveFilename (module.js:470:15) at Func...
asked by 16.04.2017 / 06:23
1
answer

app.set ('x-powered-by', false) does not work on expressjs

Hello, in my main code of my app, with the use of express, I'm trying to remove the "x-powered-by" header, and I've used both app.disable("x-powered-by") how much app.set("x-powered-by", false) In addition, I've already tried using the...
asked by 07.07.2017 / 22:29
1
answer

Object.anonymous (Express + Middleware)

> > node index.js C:\Users\cpsep\Projetos\nodejs\semparar\node_modules\express\lib\express.js:107 > throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please >...
asked by 09.08.2017 / 17:17
1
answer

Socket.io Visitor Counter

Well, this is the following I have the following code in my app.js from my project, which I took on the internet to study: // Servidor: app.js // Iniciando servidor HTTP var app = require('http').createServer(index) , io = require('socke...
asked by 22.03.2017 / 03:52
1
answer

Export function using third-party package

I have a piece of code that I use to consume a API and I use this same snippet in several files. So I created a module to export such a configuration: 'use strict' // Module to access woocommerce API endpoints var woocommerceAPI = requ...
asked by 24.04.2017 / 23:11
3
answers

How to get a word inside a string (phrase) in Node.JS

I have a question, I have a string: var frase = "Ola, bruno"; I need to get what is written to the comma and then take what is written after the comma, for example: var ABC = "Ola"; var EFG = "Bruno"; How to proceed?     
asked by 12.05.2017 / 22:57
3
answers

NodeJS Forever Not for

I have a ubuntu server, and I used the command forever restart but I forgot that I did not install a node-module, that is, when I did the command forever list it appeared stopped, then I used the command forever start server.js...
asked by 21.02.2017 / 21:28
1
answer

Read line to file line .txt

I'm trying to read a .txt file from 3.5GB line-by-line and save in the db mongo. Columns use the "|" tab. and I'm using Node js with Express. I did the test with a file smaller than 43 lines and everything worked fine but with the largest file I...
asked by 17.06.2017 / 22:13