An universal microservice registry | 一个通用的微服务注册表
A tiny and easy to use microservices registry server with express and lowdb
git clone https://github.com/nfwyst/msRegistry
npm start:dev
npm start:prod
As server is running at port 3000 by default, you can change this at config/default.js
. There are three api for manage
your informations of microservices
This will add a new record of microservice entry by send http request with PUT
method to http://localhost:3000/microservice/register/:name/:version/:port
. If the interval between the last request and the latest request is more than 30 seconds. The microservice will be expired,
so this can ensure every microservice is valid.
This will delete the record of microservice that matched by send http request with DELETE
method to http://localhost:3000/microservice/register/:name/:version/:port
This will response a suitable microservice to caller by send http request with GET
method to http://localhost:3000/microservice/find/:name/:version
. If there are multiple matches, one will be selected randomly as response, that is a part of the load balancing.
The name, version, port, refers to the name, version and port of your microservice, you should replace it. In particular, you can just specify
the main or minor number as the version when query a microservice.