All Questions

Tagged with
Filter by
Sorted by
Tagged with
8
votes
2answers
286 views

Local user registration

More javascript (nodejs) to go with the passport wrapper I just posted: UserBook.js ...
7
votes
1answer
22k views

Passing Node.js SQL connection to multiple routes

Here are the app.js, users.js and user.js routes of a node application I am building. As you can see I am connecting to the SQL DB in each route, and this is not ideal. I have tried passing the ...
5
votes
1answer
586 views

NodeJS/Express/socket.io backend

I have the backend of a socket.io script running in NodeJS for a web application. A user can login to the site and join a project collaboration (group of users linked to a project). Each project has a ...
4
votes
1answer
64 views

Correctly using promises with node-mysql

I have been trying to do a simple query and return the results with node-mysql however I had several problems. Originally I wrote it where there was no promise, but ...
4
votes
0answers
805 views

Automatically generate TypeScript classes from database tables

Made a project to generate TypeScript classes from database tables, and I'm looking for input if the code is reasonable. pg and ...
3
votes
1answer
98 views

sed-like attempt from database

The following code and test data works, but I have had to add delays between writes to MySQL otherwise it acts funny (especially on the target data set which is over 700 rows). The table is simply a ...
3
votes
1answer
511 views

My node app with valid syntax is failing silently, but not breaking. Infrastructure problem?

I built a simple Node app, and the code "works", with no failures, no syntax errors, and does not break, but one component doesn't work right. I showed a snippet on Stack Overflow, in this question, ...
3
votes
1answer
668 views

Reviewing the Dockerfile and docker-compose.yml files for a basic nodejs mysql project

I'm new to docker and after much research and stufy I've created a sample application and would like it to be reviewed in case if I'm missing any corner or if there's redundant information that can be ...
3
votes
1answer
38 views

Handling download requests using PM2

I Using Nodejs v9.10.1 for handle download operation from another application. When using PM2 in fork mode to make alive my code. After 50 minutes, this will show high memory usage. Server Config is ...
3
votes
1answer
10k views

Convert all dates in an array to date format

I'm returning an array containing dates (and other things) from an API, then looping through the array on the front end to convert them into dates The backend uses Node.Js and queries a mySql ...
3
votes
0answers
63 views

A function that debits a virtual wallet and calls an API to disburse to a real account

I am trying to determine if there is a better way to handle reversals for this function. This is how it works: A user inputs in amount, bank, and account number this would be used to debit his ...
2
votes
1answer
55 views

NODE JS Unlink and delete MySQL data

Here is my revised code from my other review question Node JS delete multiple MySQL linked records and delete physical file Just would like to hear some reviews if I have the right logic. ...
2
votes
0answers
76 views

Querying Aurora via Node.js

Function queries data from an Aurora database. Aurora database is the MySQL engine therefore, I'm querying it with a MySQL NPM module. If there is something better, I'm all ears. The calling function ...
2
votes
0answers
837 views

Async/await Mysql wrapper

I used MySQL, but it was inconvenient so I made a wrapper. It works, but I'm unsure if there are any issues. Used node module - mysql2, bluebird sqlWarpper.js ...
2
votes
0answers
458 views

Chat application built with Node

In an effort to teach myself Node.JS and truly delve into its communication capabilities, I elected to recreate a previous chatting project. It took a bit of forethought to acclimate code to the ...
1
vote
1answer
79 views

Authentication using express-session

I'm making an online shopping store or e-commerce and I use an express session for many things. Example: Shopping Cart, Authentication user* I store the data chart list in the database based on the ...
1
vote
2answers
909 views

Router for quering MySQL results in NodeJS

What should I consider in order to refactor the following code ? It seems very close to proudly become a Pyramid of Doom: ...
1
vote
2answers
16k views

Displaying MySQL table data using Node.js

I'm trying Node.js for the first time, everything works, but i'm not sure that my approach is right, can you tell me if it's ok? In this test, i've tried to get ...
1
vote
0answers
428 views

SQL transaction management in Node.js with MySQL: use the existing transaction or create a new one if none exists

I'm trying to implement a SQL transaction management in Node.js, that would append queries to an existing transaction if available, or create a new one if none exists yet, thanks to an optional ...
1
vote
0answers
46 views

Optimizing Node MySQL Query for CPU Utilization

I am working on a NodeJS port listener code that listens to a particular TCP port on the server. The obtaining the data from the port, the data is split using a delimited (for instance comma ...
1
vote
0answers
4k views

Using async/await with Node.JS MySQL

Is this the right way to use async/await with the JavaScript MySQL client? I had to use the promise-mysql package because it wraps the function calls with Bluebird promises, so that I'm able to use ...
1
vote
0answers
388 views

Connecting MySQL with connection pool in NodeJS

I'm trying to connect to a MySQL database in NodeJS. It seems it is creating multiple pool connections from multiple sources, instead of using the old one. If I try this in MySQL console: ...
1
vote
0answers
123 views

Fetch key from MySQL DB if doesn't exist in redis DB

This code gets data from a MySQL database, such that if a key doesn't exist in a Redis database, then fetching of data needs to be done from the MySQL database and then stored in Redis cache. As such, ...
1
vote
0answers
413 views

Scraping websites and saving to MySQL

I have the following piece of code which scrapes websites and saves some information back to MySQL. At the moment is consuming all the memory on my machine every time it runs. I've refactored the ...
0
votes
1answer
44 views

Scrape page and send user only new results

Review Wanted Application Summary The application is a simple screen scraper which is to notify the user when new items are posted. The code is run as a CRON job every ten minutes. It will scrape the ...