Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
(fix): script and example
Browse files Browse the repository at this point in the history
  • Loading branch information
adwpc committed Nov 26, 2021
1 parent 6fc0e09 commit 118b8c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
8 changes: 0 additions & 8 deletions examples/ion-echo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 1 addition & 9 deletions examples/ion-pubsub/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -302,4 +294,4 @@ function syntaxHighlight(json) {
return '<span class="' + cls + '">' + match + "</span>";
}
);
}
}

0 comments on commit 118b8c4

Please sign in to comment.