node.js

nodejs-database connection

I work with sockets, use sicket.io, express, node.js and still need to connect mysql. Downloaded the mysql plugin via npm. I ... e: con.end(); And now when closing the connection to the database, the server turns off, tell me, maybe there is some option?

Backend in Create React App

I started learning React, built a project using the Create React App, and now I want to start making the server part on Node. ... ds and where the backend begins, when both are written in JS, as if I can not understand something obvious and self-evident.

node.js telegram bot mouse/keyboard control

I heard that using node.js can teach the bot to control the cursor, but I can't find how to implement it. Is it possible to t ... , for example, to open a YouTube video in full screen or pause it? Is it possible to implement hotkey pressing through a bot?

Data transfer client-server Express, nodejs

I'm trying to transfer data from the client to the server, but I don't understand. HTML: <!DOCTYPE html> <html lan ... I'll try to pass the value from input. Tell me why console. log(name) is not output, I do not understand what is happening!!

How do I save a file?

The file (let it be about 1GB) in the user's browser is cut using the slice() function and sent to the partner's browser in p ... rowser using JS? I tried to just encode it in base64, but if the file size was large enough, it caused the browser to hang.

Node.js get json from the site

Interested in how to pick up json from the site and write it as json Example: const furret = require('https://pokeapi.co/api/v2/pokemon/furret');

NodeJS Telegram bot request failed API

The bot stops working after an error: FetchError: request to https://domain.ru/api/get/token failed, reason: connect ETIMEDOU ... ter a while it crashes. I don't understand what the problem is. Sometimes the bot is delayed, but not for long and so always.

How do I make the NodeJS server work without an activated console?

Gave a trial week on VPS hosting, put NodeJS there, but the problem is that it works only when the console is activated. How do I make it work indefinitely?

Asynchrony in JavaScript

I'm banging my head against the wall with an understanding of asynchrony. Please tell me, is it possible to achieve asynchro ... sable, because asynchrony will be lost? You can give an example of asynchronous code without using timers, promises, and td?

Must use import to load ES Module webpack.config.js

I decided to try the es6 Node modules.js (those that are .mjs or "type" = "module"). I write the code in typescript, the ts-l ... ules" Mistake: TypeError: Invalid host defined options at module.exports (/home/admin/web/31_MyCMS2/webpack.config.cjs:2:18)

Question about MySQL for Node.JS

I create bots for Discord using the discord module.js for Node.js. I use a MySQL database for storing users. So, in my bot th ... }) } module.exports.help = { name: 'personal' }; Please help me, I have 4 days can not understand what I'm doing wrong!

Why is NaN not equal to NaN?

console.log( null == null, undefined == undefined, NaN == NaN ); // true, true, false Why?

Events are not listened to in the connection socket.io and socket. io-client, Nodejs, Angular

Hello everyone. The code I wrote is the Server server.js const app = require('express'); const server = require('http').creat ... he other emit, on, different events, kliekn does not see, it feels like on, emit do not do anything at all, maybe who knows?)

Data exchange between JavaScript and PostgreSQL (WITHOUT node.js)

Please tell me how you can "make friends" with JS and PG? As far as I understand, directly from the browser without using Nod ... tly passes them to JS for their corresponding output on the front?! I will be glad to receive answers and bright thoughts )))

How to run a NodeJS project in the background on a Linux server

I run through the ssh server on nodejs but if I close the console windows, everything is disabled. how to make processes run in the background. I tried to use screen, but it spends a lot of memory, you need something else!

node vk bot api, error in the function with binding to the global context

I'm writing a vk bot using the node vk bot api, I want to make a response function to a command, because there are four comma ... t into the api's vc. it seems that I specified the global context when calling the function, I don't know where and how now.

express middleware in nodejs error handling

Hello everyone, I want to ask how much is correct to use this approach when processing data in express: let errorHandler = ... le, I want to pass data processing to an additional middleware, but next seems to be only for handling errors and exceptions.

Node js http/https request

function networkRequest(options) { const config = options.config; const protocol = (config.port === 443 ? https : htt ... he site does not send any data, no result is transmitted to the promise, and the entire application crashes. How to solve it?

Nginx + Node.js + phpmyadmin Setup

Good time of day! There was a task to publish the api written in nodejs. On the VPS, nginx + phpmyadmin(mysql) is installed ... } # managed by Certbot listen 80; server_name xxxxxxx.ru www.xxxxxxx.ru; return 404; # managed by Certbot }

Send photo and json together to the backend

I need to send a photo and json from the client side using one ajax, so that then in the server side, get the json text, wher ... 1606067372/lfvr9xxarnbegsp2ins7.png', size: 3299, filename: 'lfvr9xxarnbegsp2ins7' } How do I send both photos and json?