Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [node.js]

Node.js is an event-based, asynchronous I/O framework that uses Google's V8 JavaScript engine.

4
votes
2answers
126 views

Clearing up misconceptions about a Flask backend and client-side rendering

I am building a website and along the way I have come across a lot of things I didn't know about and was hoping to get some help in understanding some of them. I started building a website using ...
1
vote
1answer
27 views

Correct way to serve file that's in node_modules

Say I have this structure: project/ node_modules/ xxx/ asset.js index.html app.js and in app.js I have: const express = require('express'); const app = express();...
-2
votes
1answer
46 views

How to implement security and authentication with a React/ Node.js and PHP based web app [closed]

First, I would like to say I understand if this may not exactly follow the general guidelines of a good question due to it's open-ended nature, but I do genuinely need advice on this subject. I am ...
-1
votes
0answers
36 views

How many request we can make at a time using “request” middle ware in nodeJS application

I am running a cron job every 5 mins to get data from 3rd party API, It can be N number of request at a time from NodeJS application. Below are the details and code samples: 1> Running cron Job every ...
0
votes
1answer
34 views

NodeJS - Mitigating Supply Chain attacks [closed]

JavaScript and NodeJs in particular are incredibly popular however one of it's key strengths is also a weakness, the use of open source modules. My question is specifically around how you can ...
0
votes
1answer
61 views

Best route naming convention when a RESTful GET needs to be a POST

I have a REST API that has been built on top (in front of) a legacy system, to allow 3rd parties of various platforms to interact with the system. Most of the time, I can define a resource and create ...
1
vote
0answers
25 views

avoid passing dbsession object to multiple modules

I have a project which has a service-oriented architecture. for example, anything relates to payment is inside payment module. -dao -config -constatnts -middlewares -modules -payment -user -...
10
votes
2answers
403 views

How can I prevent a user from editing my code in their browser?

Description I'm designing a Node.JS application (more like a full website). The app will send five JavaScript files and will have <script> tags linking them together. Question How can I ...
-1
votes
3answers
92 views

Writing elegant promises in Node.js

I am having a real difficult time writing some clean code with a simple user registration/login manager. I am trying to stay out of nesting/callback hell, and am also not seeing any benefit in using ...
0
votes
0answers
14 views

Understanding aws implementation for transferring data (CSV) from S3 to redshift datastore

I know there are a number of articles only and tutorials that show using RedShift COPY to get a CSV file/content into a redshift database. My question is on implementation. My thought is to place a ...
0
votes
0answers
23 views

npm subfolders and git submodule

So I'm wondering how I should go about this. I have a frontend and a backend that's currently meshed together as one git repository. I would now like to separate them into a front end repository and ...
-3
votes
2answers
177 views

Is this an anti pattern in Javascript?

A common pattern I've been using for JS/NodeJS applications is the following: import { utility1, utility2 } function exampleScript() { utility1() utility2() // Does something } Basically my main ...
2
votes
1answer
176 views

Best practices for Docker image node version and .nvmrc

If I'm building microservices using Node on Docker images - it's necessary to keep an idea of what version of Node I'm using. The idea is - I'm going to be running Node locally in development - and ...
0
votes
1answer
149 views

What is it that is so hard about ES6 modules for Node? [closed]

It seems like ES6 imports for Node have been a bugbear for a while. There is the --experimental-modules flag, or options like using Babel - but AFAIK ES6 modules still aren't supported in vanilla Node....
1
vote
1answer
173 views

How to store blog post in database - React & GraphQL

I am building travel blog using React as frontend Javascript framework along with GraphQL. I am doing this project by myself as a pilot test and I am currently in a phase of translating photoshop ...
0
votes
0answers
45 views

separating git repositories for frontend / back end

So I currently have this situation. I'm developing with Vue, and I've got my backend files in the same repository as my frontend (Vue) files. Now, I want to move to typescript and use webpack with ...
0
votes
0answers
39 views

How do I abstract out HttpResponse creation but still allow for custom status codes

I have build a custom back-end in NodeJs using the chain of responsibility pattern so that the system can easily be extended to handle new kinds of requests without modifying existing RequestHandlers. ...
0
votes
0answers
29 views

How should I store multiple, related models when configuration control is required?

My problem: I plan to store a "project" in a database, where a project is composed of multiple items e.g. documents, and each document has multiple items e.g. paragraphs. Paragraphs may cross-...
4
votes
1answer
183 views

Managing private NPM packages and CI/CD

At work we have an application that is run directly on dev machines, but deployed to Docker swarms (a QA swarm and production swarm). The code and CI/CD pipelines are all in GitLab CE. It uses ...
4
votes
1answer
58 views

How do I automate build-publish tasks for my web server?

I'm developing a node.js web server which will have built source code of server and client part at once. I mean, my web server is on the isomorphic level. this means editing source code of client part ...
0
votes
1answer
43 views

How to route/implement port forwarding with AWS/Apache web server (httpd) with a Node.JS app on port 3000?

I'm trying to understand this and having a hard time. I usually use Ubuntu server, with Apache2, and this time I am not. So I'm a bit out of my element. I'm also a software developer and I don't do ...
3
votes
1answer
307 views

NodeJS (ES6): Design Pattern with bind usage

The question is related to the resolution of the this operator in Javascript classes. NodeJS now supports ES6 classes. The problem faced during this is that when a new instance of the class is created ...
0
votes
0answers
55 views

How to create a router-like configuration page on Raspberry PI?

We have a Raspberry PI (with raspbian OS) that runs some application, this application uses a local configuration file that contains some data like username, password, server url etc. We will provide ...
1
vote
1answer
37 views

JavaScript/NodeJS Class Extension vs Adding Properties

I am currently writing a Discord bot and have reached the point of needing a refactor. With this being my first stab at JavaScript/NodeJS and making a bot in general, there are a lot of mistakes I ...
-3
votes
1answer
88 views

ASP.Net WebAPI or Node JS?

I wish to write RESTful web services which can be consumed from a Web Application and a mobile application. The database is designed in SQL Server 2012. I estimate that there won't be more than 1000 ...
-1
votes
1answer
80 views

How to develop larger client-site in-browser apps in javascript?

I'm new to javascript environment (I have background in C++ physical simulations and game engines). With rise of HTML5 and WebGL I was thinking I'd like to try make some games/3D editors using ...
0
votes
1answer
167 views

Class definitions in static getter methods

[Node.js / CommonJS] I'm creating a single GitHub repo for my tool which has a Core, Control, Server, and Client library. It's unlikely that all of them will be used at the same time. I'd like my ...
1
vote
1answer
56 views

Upgrading outdated node.js with many dependencies, should it be done incrementally?

If one wishes to upgrade from Node 0.10.48 all the way to the latest LTS version (8.11.2 as of right now) would it be smart to upgrade only to version 0.12.18 first, and then to 4.9.1 and so on? The ...
0
votes
0answers
64 views

Defining a Semtech UDP protocol packet: Is good idea to use google's protobuf

In an attempt to make a LoraWan node simulator using node.js: https://bitbucket.org/lora_ssl_unipi_sec1718/lora_node_simulator/src/master/ But I have a hard time to define a packet in a similar ...
-7
votes
1answer
119 views

Writing tool to make large number of http requests with sub second accuracy

I'm pondering a project in which one component needs to make a large number of http requests at accurate times. It should, let's say, release a set of 'dozens to hundreds' of requests at 1 second ...
2
votes
1answer
72 views

Does using MEAN stack reduce the need for code and data structures compared to ASP.net with SQL?

I've been writing web applications for almost 10 years. The ASP.net stack has been my bread and butter and although it has a lot of great things about it, I honestly never chose ASP.net. It's just a ...
0
votes
1answer
43 views

Is it a good idea to pass an URL as a parameter for a pass through service?

I'm developing a service in node JS that will act as a middleware for a client calling a third party API. My service will make some security and user roles checks before calling the third party. So ...
2
votes
1answer
118 views

What is the best way to maintain synchronicity between a table that has a list of another table?

I used to do Java development and with JPA, I don't really have to worry about the synchronicity between a table and the lists it owns. For those who don't understand what I mean, here's an example. ...
0
votes
0answers
29 views

GIS design for reducing of traffic and number of requests to server

I explore the world of GIS and try to elaborate an architecture of a GIS service with a lot of objects on a map. Currently, I'm loading all the items in the visible map area. In order to keep a map ...
7
votes
2answers
352 views

Do CPU Intensive/ Data Intensive Tasks belong on the Server

I'm new to server development, and I'm trying to figure out where the division of responsibilities is for Data intensive tasks, I'm using Node.js. As an example say I'm making a Single Page ...
-4
votes
1answer
131 views

Performance comparison of Legacy VB6 Software vs Node.js and React.js

my company just started a new production management software by using serial communication to scales. My company has already developed the software using VB6 in 2006 and keep using that outdated ...
3
votes
2answers
118 views

Securing an API key in a web extension

I'm building a web extension that will be a wrapper for a public API. There aren't any paid tiers for the API currently, but I'm trying to secure the API key so it doesn't get stolen and used outside ...
0
votes
1answer
97 views

Algorithm for graphing heap data from server memory, over long period of time

Right now I am collecting memory information on a node.js server every 100 seconds. I want do display the memory usage info as a graph on the front end. const mem = { heapTotals: [], heapUseds: []...
0
votes
0answers
93 views

LGPL restrictions for a module in a nodejs project

I'm using an open-source LGPL module in a commercial Node.js project where we deploy our Node.js code on the client's servers. I've read that, amongst other legal specifications, i should make it ...
3
votes
2answers
134 views

Does prefetch data by Apache before serving a SPA site hurt performance?

I have this application containing 2 parts: User-facing SPA web served by Apache NodeJS API server When a user go to the SPA web, Apache will do authentication and prefetch data for that user by ...
1
vote
1answer
129 views

How to create a framework in Express.js

I'm trying to figure out how to create a Node.js/Express.js application that is a framework for hosting and running third-party code in my application, and what are the appropriate JavaScript/Node/...
1
vote
0answers
498 views

design pattern/oop for large validation rule set

I'm writing this in node.js I have some data that needs validating before anything can be done with this. The data is validated in two different ways. I can use JSONSchema to validate the structure ...
-2
votes
1answer
135 views

Linux Server Hosting through Cloudflare [closed]

I hosted a hobby NodeJS Server from my Linux and all is fine by accessing my direct IP. Because I find this ugly and also less secure, I decided to route my domain which is set to Cloudflare to my IP....
3
votes
1answer
171 views

How to name two functions that could be named the same?

I have a node app with a queue for processing jobs in the background. I have a file that exports a function which when run, creates a job in my queue. In that file, I also have the handler for this ...
-2
votes
1answer
291 views

PHP or NodeJS for a chat app with message queue

In my company I proposed NodeJS for developing a microservice that acts as a bridge between the front-end and a third party chat API, that Microservice will receive large amounts of messages (about ...
0
votes
1answer
44 views

Performant way for archiving image files in NodeJS on each user requests

Scenario: Images are uploaded to the server once in a while. Users send an API request for downloading all of those images that were uploaded to the server (Images reside in the server itself). ...
0
votes
0answers
47 views

How to implement a session mechanism for an always-open SaaS platform

The SaaS platform I'm working on should have a rather desktop-app-esque feel to it. Meaning it would be the main management software for my client's businesses and will be always open on their ...
0
votes
1answer
212 views

Deploy a NodeJs (FrontEnd) and a Spring (BackEnd) project as one artefact

I have a current project which consist out of two independently developed projects: Spring REST as back end Angular as front end I do have a Jenkins instance available for building my projects and I'...
1
vote
1answer
288 views

Handling Pausable Streams with RxJS

Reading a Node Stream I want to be able to receive a stream of text, and trigger the continuation of my stream. The following code solves my purposes but I recently read that we are using Subject too ...
5
votes
1answer
241 views

Nodejs cluster: are there any downsides?

I was reading a litte about clusters in nodejs, and in all cases it was trivial to clusterize the application. In fact, it was so easy that I began to wonder: are there any cases that I shoudn't use ...