Skip to content

microservices service-registery written in nodejs

License

Notifications You must be signed in to change notification settings

oxmagdi/holter.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

You must have npm installed on your computer. From the root project directory run these commands from the command line:

$ npm install

Running

make sure you installed Redis and Redis server is working

$ redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> 

Environment Variables:

echo 'PORT=4600' >> .env
echo 'NODES_CONF_DIRENAME=/home/holterconfs/' >> .env
echo 'REDIS_HOST=127.0.0.1' >> .env
echo 'REDIS_PORT=6379' >> .env
echo 'REDIS_PREFIX=h' >> .env

Unit Testing

$ npm test

Development mode

$ npm run dev

Production mode

$ npm run server

Add New Node Object

There are two ways to add new node

1- Via UI

UI

2- Manually

Just make a new <NODE_NAME>.json on Configs Files Directory (the path You define it in Environment Variables as NODES_CONF_DIRENAME)

{
    "cluster": "",
    "node": "",
    "host": "",
    "port": "",
    "path": "",
    "onfailure": {}
}

onfailer.type could be Script

"onfailure": {
    "type": "script",
    "command": ""
}

OR Endpoint

"onfailure": {
    "type": "endpoint",
    "url": "",
    "method": "",
    "headers":{},
    "body": {},
}