2021-10-07 13:46:34 +08:00
|
|
|
import { AppConfig, ServiceRegister } from "../src/index.js.js";
|
2021-09-25 20:33:10 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
});
|