From 118b8c419822088b948d98466a9e173b7fe50317 Mon Sep 17 00:00:00 2001 From: adwpc Date: Fri, 26 Nov 2021 10:37:59 +0800 Subject: [PATCH] (fix): script and example --- Makefile | 18 ++++++++++-------- examples/ion-echo/main.js | 8 -------- examples/ion-pubsub/main.js | 10 +--------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 6694c68de..61d3cf7e6 100644 --- a/Makefile +++ b/Makefile @@ -22,17 +22,19 @@ app: clean: rm -rf bin -start-bin: +scripts-start-services: + ./scripts/all start -start-services: - docker network create ionnet || true - docker-compose -f docker-compose.yml up -d redis nats +scripts-stop-services: + ./scripts/all stop -stop-services: - docker-compose -f docker-compose.yml stop redis nats +docker-start-services: + docker-compose pull + docker network create ionnet + docker-compose -f docker-compose.yml up -run: - docker-compose up --build +docker-stop-services: + docker-compose -f docker-compose.yml stop test: go_deps start-services go test \ diff --git a/examples/ion-echo/main.js b/examples/ion-echo/main.js index 4c6441e36..54d784505 100644 --- a/examples/ion-echo/main.js +++ b/examples/ion-echo/main.js @@ -42,14 +42,6 @@ const join = async () => { console.log('[onleave]: leave room, reason ' + reason); }; - function Uint8ArrayToString(fileData){ - var dataString = ""; - for (var i = 0; i < fileData.byteLength; i++) { - dataString += String.fromCharCode(fileData[i]); - } - return dataString; - } - room.onmessage = function (msg){ console.log('[onmessage]: Received msg:', msg) const uint8Arr = new Uint8Array(msg.data); diff --git a/examples/ion-pubsub/main.js b/examples/ion-pubsub/main.js index 565316bcc..f9b8346c4 100644 --- a/examples/ion-pubsub/main.js +++ b/examples/ion-pubsub/main.js @@ -50,14 +50,6 @@ const join = async () => { console.log('[onleave]: leave room, reason ' + reason); }; - function Uint8ArrayToString(fileData){ - var dataString = ""; - for (var i = 0; i < fileData.byteLength; i++) { - dataString += String.fromCharCode(fileData[i]); - } - return dataString; - } - room.onmessage = function (msg){ console.log('[onmessage]: Received msg:', msg) const uint8Arr = new Uint8Array(msg.data); @@ -302,4 +294,4 @@ function syntaxHighlight(json) { return '' + match + ""; } ); -} \ No newline at end of file +}