Skip to content

Commit

Permalink
switched off logging during test cases & added more intro
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinDmello committed Oct 9, 2016
1 parent ef8d5fc commit c5f43e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Heinrich
# Heinrich

A lightweight load-balancer written in Node.js which is highly available. It's made using the Reactor pattern in Node along with support for worker processes (one per core). You can however run a simple load-balancer with a single process by disabling the multiCore feature.

The load-balancer is programmed for high availability i.e if the worker process gets killed, it will be restarted. This ensures that the load on the other processes doesn't increase substantially.

You can also configure an smtp server with `heinrich`. Mails will be sent whenever one or more of the backend servers go down.

Currently you'll have to clone the project & run the main file. I'll be writing installation & startup scripts for ubuntu & centos servers.

-------------------------------------------------------
### Configuration file :-
The config.json file holds the entire config.

Expand Down Expand Up @@ -33,6 +36,8 @@ Example :-
"cert": "/home/keys/cert.pem"
}
```

-------------------------------------------------------
#### Options :-
#### port
The port on which your load-balancer will run. The worker processes will share the same port and internally load-balance.
Expand Down Expand Up @@ -77,7 +82,7 @@ This will have the absolute address of the key
#### cert
This will have the absolute address of the certificate.


-------------------------------------------------------
### Project roadmap :-

- [x] random routing
Expand Down
8 changes: 5 additions & 3 deletions utilities/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ function logger() {}
module.exports = logger

logger.prototype.log = function() {
console.log(new Date().toLocaleString(), arguments)
if (process.env.NODE_ENV !== 'test') {
console.log(new Date().toLocaleString(), arguments)
}
}

logger.prototype.error = function(){
logger.prototype.error = function() {
console.log(new Date().toLocaleString(), arguments)
}
}

0 comments on commit c5f43e1

Please sign in to comment.