feat: register service.
This commit is contained in:
19
examples/register.ts
Normal file
19
examples/register.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { AppConfig, ServiceRegister } from "../src";
|
||||
|
||||
const config: AppConfig = {
|
||||
etcd: {
|
||||
hosts: "http://rpi:2379",
|
||||
},
|
||||
};
|
||||
|
||||
const register = new ServiceRegister(config);
|
||||
|
||||
register
|
||||
.register("example.configuration.fennec", "https://ivanli.cc")
|
||||
.then(() => {
|
||||
console.log("registered!");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn("failed!");
|
||||
console.error(error);
|
||||
});
|
Reference in New Issue
Block a user