diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..05ef37a
Binary files /dev/null and b/.DS_Store differ
diff --git a/app/.DS_Store b/app/.DS_Store
new file mode 100644
index 0000000..d4d34f8
Binary files /dev/null and b/app/.DS_Store differ
diff --git a/app/public/demo-app-diagram.png b/app/public/demo-app-diagram.png
new file mode 100644
index 0000000..590cd7f
Binary files /dev/null and b/app/public/demo-app-diagram.png differ
diff --git a/app/public/github.png b/app/public/github.png
new file mode 100644
index 0000000..4e9fed9
Binary files /dev/null and b/app/public/github.png differ
diff --git a/app/public/github.svg b/app/public/github.svg
new file mode 100644
index 0000000..53bd7b2
--- /dev/null
+++ b/app/public/github.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/public/index.html b/app/public/index.html
index e5715d6..b610477 100644
--- a/app/public/index.html
+++ b/app/public/index.html
@@ -7,23 +7,35 @@
var running = false;
function increment() {
+ var status = $("#status");
+ var zone = $("#zone");
+ var counter = $("#counter");
+
if (running) {
return;
}
running = true;
- var counter = $("#counter")
+
$.post('/increment', function (data, textStatus, jqXHR) {
if (data.err == null) {
- counter.removeClass("error");
- counter.text(data.zone + ": " + data.counter);
+ status.removeClass("error");
+ status.text("Everything is working")
+ counter.text(data.counter);
+ var zoneVal = data.zone;
+ if (zoneVal == null) {
+ zoneVal = "unknown";
+ }
+ zone.text(zoneVal);
} else {
- counter.addClass("error");
- counter.text("redis: cannot connect");
+ status.addClass("error");
+ status.text("Cannot connect to: redis")
+ counter.text("-");
+ zone.text("-");
}
running = false;
}).fail(function(){
- counter.addClass("error");
- counter.text("app: cannot connect");
+ status.addClass("error");
+ status.text("Cannot connect to: demo-app")
running = false;
});
}
@@ -35,6 +47,10 @@
}
$(document).ready(function() {
+ var status = $("#status");
+ var zone = $("#zone");
+ var counter = $("#counter");
+
$.get('/version', function (data, textStatus, jqXHR) {
$("#header").css("background-color", data.color);
$("#version").text(data.version);
@@ -42,11 +58,21 @@
$("#content").removeClass("hide");
});
$.get('/counter', function (data, textStatus, jqXHR) {
- var text = data.zone + ": " + data.counter
- if (text == null) {
- text = "0";
+ var counterVal;
+ var zoneVal;
+ if (data == null) {
+ counterVal = "0";
+ zoneVal = "unknown";
+ } else {
+ counterVal = data.counter;
+ zoneVal = data.zone;
+ if (zoneVal == null) {
+ zoneVal = "unknown";
+ }
}
- $("#counter").text(text);
+ console.log(data);
+ counter.text(counterVal);
+ zone.text(zoneVal);
});
$("#increment").click(function(){
@@ -67,6 +93,11 @@
});
@@ -121,7 +354,69 @@
Loading...
-
+
+
+
+
Kuma Counter Demo
+
+ Welcome to a simple demo application to demonstrate how the Kuma service mesh works. This application allows us
+ to increment a counter, and it is made of two different services:
+
+
+
demo-app: To serve the backend API and this frontend