This is going to be a simple node.js express server whose 4 instances are going to be run on localhost on different ports using pm2 npm module, and nginx is going to be used to load balance them. The nginx server will also be on localhost.
So basically, http://localhost/ will redirect amongst the servers running on different ports of localhost (example: http://localhost:3000/, http://localhost:3001/, etc).
There are several articles very similar to this, but I am writing this because I wasn’t able to follow them properly, especially on windows, and to make it simple for the readers to execute, as it becomes very frustrating for readers to follow an ambiguous article. …
ob·fus·cate
Coming to software development, obfuscation is the deliberate act of creating source or machine code that is difficult for humans to understand. Programmers may deliberately obfuscate code to conceal its purpose (security through obscurity) or its logic or implicit values embedded in it, primarily, in order to prevent tampering, deter reverse engineering, or even as a puzzle or recreational challenge for someone reading the source code. This can be done manually or by using an automated tool, the latter being the preferred technique in industry. — source ‘wikipedia’.
Let us create one such tool, which can later be automated, for javascript. …
This article will be quite helpful for beginner javascript developers who have just started developing in it. I learned about this while learning Reactjs where it can make quite a difference.
Javascript has 5 data types which are passed by value, which are : Boolean
, null
, undefined
, String
and Number
. What I mean by pass by value is that when I do:
let a = 5
let b = a
console.log(a, b) // result is 5 5
But both the variables are stored in different addresses. So when I do something like this:
let a = 5
let b = a
b = 3
console.log(a,b) //result is -> 5…
This article is to illustrate how to create a basic app in Node.js using express and hbs (as the view engine). We will be creating a very simple and basic elections app, which will run on your local host. On running it you can choose from one of the 3 candidates provided and it shows you the current results on it.
I strongly believe that a language or a framework should be learnt from the basics and this is not the ideal method for you to learn node.js and express from scratch. But this will be helpful for people who want to get a feel of node.js …
About