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

learn more… | top users | synonyms (1)

1
vote
0answers
24 views

Node JS Tape Unit Testing : All cases inside one function for a method

I am using tape for unit testing in Node JS. I wanted to ask one thing about better coding while writing unit testing. When using different inputs to a single method, is it a better idea to use all ...
0
votes
1answer
34 views

requiring files in nodejs - individual files or group?

When working in NodeJS and requiring custom modules. Is it best practice to require one file that itself requires dependencies, or is it best to explicitly require only the files that are needed? An ...
-1
votes
1answer
33 views

node server structure and technologies - support continuous and high volume (amount, not size) data transfare

I'm having trouble planning the structure of my server side workflow and the technologies I should use. The basic structure and tasks are: Now, things to consider: 1.the server listens to multiple "...
0
votes
1answer
97 views

Micro service architecture : Solving complex queries owned by particular service

I am working micro service architecture and figuring out what is the best way to get complex data from a micro service. So for example : Let's say micro service A is owning data based on any CRUD ...
0
votes
2answers
89 views

Matching 2 sets of items by price

I'm trying to solve the following problem in the most efficient way I can find. I want to trade my items for someone elses items, every item have a price and a value. I want to maximize the value of ...
1
vote
1answer
97 views

How to handle UI updates dependent on slow API responses

A side project I'm working on with some friends currently deals with an API interface that, for many reasons, is slow and cannot be changed to improve speed. I'm talking API responses that take ...
1
vote
1answer
43 views

Split requests between different server applications

I currently have a web server running apache with multiple sites on it using virtual hosts. I want to add a service to my server that is using nodejs but I want it to be accessible under the same ...
-1
votes
1answer
107 views

Node.js script const variables in SCREAMING_SNAKE_CASE or camelCase

TL/DR: When requiring another script in Node.js and defining it as a const should the variable name still be in camelCase like it was usual with var or should it instead be in SCREAMING_SNAKE_CASE as ...
0
votes
0answers
72 views

Best Practices to Validate Complex Input Data and Apply Business Logic

I have to implement some complex validations and business logic in a REST API. As I am not that experienced with designing such complex systems I would appreciate if someone could check whether my ...
1
vote
0answers
45 views

Design high load app to the cloud [closed]

We started to work with CF version 2.92 , and before I start to develop the new application/service I want to get some inputs since this is the first time that I need to develop for the cloud high ...
1
vote
1answer
33 views

Where should I do integration tests in a multi package project

Background: I am working on a node project which consists of a core package and several addon packages. For the end product to work, the core package and atleast one of the addon packages should be ...
0
votes
1answer
107 views

How to serve a computationally intensive application via REST? [closed]

I have got a native image processing application that can enhance photos(peApp). Now, I want to serve this functionality to the world by having a server application that supports REST. Now while ...
0
votes
0answers
233 views

Node.js server game using socket.io architecture

I'm designing a multiplayer game using Node.js and the socket.io library to communicate with my clients. Basically, all clients connect to a the same lobby (specific socket.io namespace) where they ...
0
votes
1answer
52 views

Best practice to send data to webhooks without multiple redirects

I’m building a payment system for some ebooks with Reactjs on the frontend, Firebase as hosting and database and cloud functions at the backend side. Customers don’t need an account to buy ebooks so ...
-3
votes
1answer
80 views

maintaining indexing on json files

I have a directory which has approx. 100k JSON files. I want to retrieve a list of file names, where the file satisfies a set of conditions, with a filter condition in same format as we can pass the ...
0
votes
2answers
50 views

What is the principle that the npm module drydock can provide data at the port when the local web server is already using that port?

When a local web server is already running at port 3000, I wonder why the npm module drydock is able to provide data also through port 3000? I thought once a port is used, then other process cannot ...
0
votes
1answer
46 views

architecture - relation of scraper and orm classes

Consider the following application structure. The scraper class extracts the necessary information from a page, and I want to save it to the DB. The ORM class is a wrapper around sequelize.js. It ...
3
votes
2answers
89 views

REST API with files as resources?

I'm storing files as REST API resources, sending and receiving them as base64 strings, along with some other metadata. What's the best way to handle GET for the collection? (e.g GET .../api/files) ...
-1
votes
1answer
178 views

Deployment process for deploying nodejs application to production using webpack

I'm trying to work out what the correct process for deploying a nodejs application to a production environment should me, using webpack. If this was a standard Java/Maven project I might do ...
2
votes
4answers
176 views

Should exceptions not be thrown in Node.js?

I just started working on a new project and no one throws exceptions over here. I get that you shouldn't be doing that for asynchronous code, but it seems to be a valid way to do things for the ...
0
votes
1answer
108 views

Implement a HTTP server on top of NodeJS TCP APIs for learning purposes

I am very interested to learn the HTTP protocol in depth as well as understand the working of NodeJS streams up-close. I figured out that the best way to do this would be to develop an HTTP server in ...
-5
votes
1answer
227 views

How does the typescript transpile function work

Assume the following: /// file.ts var x = "hello"; x = 1; console.log(x); /// file.ts function transpile(fileName) { ... } What steps would typescript take to transpile the file? How and when ...
0
votes
1answer
70 views

Should I use mongoose / mongodb to handle my user REST session in nodejs? [closed]

I'm working on a project which has the following development strategy: Frontend: Angularjs Backend: NodeJs DB: Mysql I'm bulding a REST system with nodejs and I was wondering how should I handle the ...
0
votes
2answers
50 views

Getting an existing resource in an OOP server API

Background I've designed and implemented a server app - a stateless REST API that mostly deals with customer CRUD operations. As it is now the server is designed to use modules for each ...
0
votes
0answers
99 views

Design GraphQL Mutations for fields that's receive interfaces

GraphQL is a new cool pattern to create APIs. But like every new thing, we don't have much relevant examples for difficult situations and the most part of the examples are for creating TODO Lists. :( ...
0
votes
0answers
228 views

PHP and Node.js-powered WebSockets communication

I'm here, because I would like to ask how can I possibly implement two-way communication between PHP & Node.js. The scenario is as follows: Currently I only use PHP -> Node.js communication via ...
1
vote
2answers
322 views

What risks are there to using Node.js with Java EE?

We are developing a B2B web application in which we are using(suggested by seniors) two servers. One is Node.js (to serve all the request related html & static content) and the other is Tomcat to ...
2
votes
1answer
870 views

Microservices Architecture separating backend and front end

We are trying to move (slowly) into Microservices architecture from our current monolithic based architecture. I've done my research on microservices architecture and would like to get some feedback ...
0
votes
0answers
57 views

Middle-tier/SDK Design Advice

This question was determined to be too broad for stack overflow, so I am reposting here. I am looking for advice on an optimal architecture pattern that will meet the needs of my application. I ...
3
votes
2answers
959 views

Is it bad design to internally call API endpoints from within the API instance?

For context, I am running a REST API built with Node.js. Because of callbacks and some complex DB calls, I have a chain of functions that are async but also unique, so it's tough to reduce redundancy. ...
0
votes
0answers
38 views

When developing React + Express app, better method than building after every code change?

I used create-react-app to make a React app, and while developing I would serve it on localhost:3000 with npm start. And create-react-app sets up my npm scripts so that when I made a code change, it ...
0
votes
0answers
136 views

Best practice to maintain 2 servers - PHP and NodeJs

We have a Symfony backend server for our Android and iOS application. Recently we need to extend our application by supporting real time interaction such as chatting, and we decided to use NodeJs with ...
4
votes
3answers
453 views

Realtime frontend dashboard, calling api every 3 seconds, reduce cpu loads

I am working on a networking project. Where I am creating a dashboard to view real time status (CPU/memory usage, up/down traffic and few others) of multiple routers by calling API request to server ...
1
vote
0answers
124 views

Make PHP run like NodeJS [closed]

I like how NodeJS works, the program runs once, includes whatever it needs in order to function, defines its routes and then starts serving requests. On the other hand there is PHP - every request ...
0
votes
0answers
46 views

Am I using the right frameworks effectively?

I am working on a large scale application that has both a web portal and a mobile application so therefore I need to develop an API.. I have decided to go with the following structure:- Sailsjs (...
-1
votes
1answer
437 views

Is this Big Data architecture good enough to handle many requests per second?

I want to ask for a review of my big data app plan. I haven’t much experience in that field, so every single piece of advice would be appreciated. Here is a link to a diagram of the architecture: My ...
-1
votes
1answer
215 views

I'm building an app with Node, Express, and MongoDB. Is AngularJS necessary?

Node, Express, and MongoDB are really connected so I can understand why they are frequently used together. For a web app of medium complexity, can I get away with only using HTML/CSS and EJS for the ...
0
votes
0answers
82 views

Node.js - Native promises executing individual parallel batches of items one at a time

I'm a newcomer to using Promises, so I'm trying to figure out how to use them for a task, but I'm having a hard time mapping what I read in the simple examples on the internet to this task. I have ...
5
votes
2answers
101 views

Tracking state changes based on duration of time in state

I've been building a monitoring system that checks whether a device is alarmed or not, and if so, sends notifications to relevant users based on how long a device is in a particular state. Here's an ...
0
votes
0answers
354 views

IPC with Node.js server

I built a post processor for creating CNC machine files to which I'd like to provide a web interface. Currently the program takes a file path as input and then spits out the results into another file....
0
votes
1answer
34 views

Creating a better translation for a node.js api to ruby

My client has a nodejs SDK that fetches entries using a client that makes http requests. Their api looks like this: var Query = Client.ContentType('blog').Query(); Query .where("title", ...
1
vote
0answers
151 views

Designing large nanoservice architecture with AWS Lambdas

I'm moving from a coupled architecture to a decoupled architecture using microservices with AWS Lambda. Here is my current architecture: Each API Gateway route is linked to a specific Lambda, each ...
1
vote
0answers
294 views

Designing a Feed and Notification system in MongoDB

I'm developing a NodeJS API that will be consumed, for now, by an Android app. I need 2 important things here: a News Feed and a Notification system. And I need it to be scalable. I'm using ...
1
vote
0answers
215 views

(Node.js) It is possible to use a LGPL module on a Electron app licensed as Apache 2.0?

I'm developing a desktop app (using Node.js and Electron), licensing the code under Apache License v2.0 It's possible to add a module, licensed as Lesser GPL v3, to my app? I know that compiled ...
1
vote
2answers
201 views

What's a good way to deprecate your NPM modules?

One of my NPM modules is, frankly, pretty lame, hasn't been worked on in years, has no watchers, no stars, and only ~50 downloads per month. I'm going to abandon it, and eventually delete it so it ...
1
vote
1answer
124 views

Howto structure my app.js code to make it easier testable

I have a couple of Philip Hue lights in the hallway. These show the build status on their lights with a small Node.JS application. Its working like a charm. Currently I am in the process of testing ...
0
votes
0answers
25 views

Dropping bad data on Mongoose Schema versus throwing an error?

I know that this forum is more for abstract questions that one would solve in front of the whiteboard instead of asking specific technology questions, but I think this is abstract enough that it ...
4
votes
2answers
216 views

Is it bad practice to generate ids for an object that does not yet exist in the database?

Here is the situation: There is a Mongo database A and there is Mongo database B. There is a business concept/Mongo object that is called someModel which exists on one of database B's collections. ...
7
votes
2answers
125 views

Is repeating an identifier on an API request and response considered a code smell

Is it weird to have an identifier such as (_id) on a request which you send to the API, which "enriches" the request and sends back a response with the same identifier (but obviously more enriched ...
6
votes
2answers
225 views

What do you call the layer of modules that call external APIs?

I'm creating a Node app. I have JavaScript files that include custom functions that make calls to external APIs (in this case Google APIs) I have JavaScript files in my node app that are related ...