Merge branch 'next' of gitlab.vmic.xyz:vivo-fed/dubbo-js into next
diff --git a/etcd-docker/etcd.yaml b/etcd-docker/etcd.yaml
new file mode 100644
index 0000000..7590c8b
--- /dev/null
+++ b/etcd-docker/etcd.yaml
@@ -0,0 +1,34 @@
+version: '3'
+networks:
+ ? byfn
+
+services:
+ etcd1:
+ image: quay.io/coreos/etcd
+ container_name: etcd1
+ command: etcd -name etcd1 -advertise-client-urls http://0.0.0.0:2379 -listen-client-urls http://0.0.0.0:2379 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster -initial-cluster "etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380" -initial-cluster-state new
+ ports:
+ - 2379
+ - 2380
+ networks:
+ - byfn
+
+ etcd2:
+ image: quay.io/coreos/etcd
+ container_name: etcd2
+ command: etcd -name etcd2 -advertise-client-urls http://0.0.0.0:2379 -listen-client-urls http://0.0.0.0:2379 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster -initial-cluster "etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380" -initial-cluster-state new
+ ports:
+ - 2379
+ - 2380
+ networks:
+ - byfn
+
+ etcd3:
+ image: quay.io/coreos/etcd
+ container_name: etcd3
+ command: etcd -name etcd3 -advertise-client-urls http://0.0.0.0:2379 -listen-client-urls http://0.0.0.0:2379 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster -initial-cluster "etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380" -initial-cluster-state new
+ ports:
+ - 2379
+ - 2380
+ networks:
+ - byfn
diff --git a/examples/hello-midway/src/app.ts b/examples/hello-midway/src/app.ts
index ebc7ad9..6f1736a 100644
--- a/examples/hello-midway/src/app.ts
+++ b/examples/hello-midway/src/app.ts
@@ -21,7 +21,7 @@
export default async (app: Application) => {
console.log('π Your awesome APP is launching...');
await dubbo(app);
- await app.dubbo.ready();
console.log('dubbo was ready..');
+ await app.dubbo.ready();
console.log('β
Your awesome APP launched');
};
diff --git a/examples/hello-midway/src/config/config.default.ts b/examples/hello-midway/src/config/config.default.ts
index 90dfc8d..9114511 100644
--- a/examples/hello-midway/src/config/config.default.ts
+++ b/examples/hello-midway/src/config/config.default.ts
@@ -28,6 +28,17 @@
// add your config here
config.middleware = [];
+ /**
+ * dubbo config
+ *
+ * application ε½εηεΊη¨ζ θ―
+ * register 注εδΈεΏε°ε
+ * support registry mode
+ * 1γ zookeeper 'localhost:2181,localhost:2182,localhost:2183'
+ * 2γ nacos 'nacos://localhost:2181'
+ * nacos 注εε°εθ¦δ»₯ nacos:// εΌε€΄
+ *
+ */
config.dubbo = {
application: 'hello-midway',
// zookeeper ηιΎζ₯
diff --git a/start_etcd.sh b/start_etcd.sh
new file mode 100755
index 0000000..bc9f7da
--- /dev/null
+++ b/start_etcd.sh
@@ -0,0 +1,2 @@
+cd etcd-docker
+docker-compose -f etcd.yaml up