diff --git a/README.md b/README.md index 25beaac..8b6ccd2 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,20 @@ Follow the directions here: https://cloud.google.com/run/docs/tutorials/system-p To test locally +``` docker build -t tsl/api . #use --no-cache to ensure a fresh build docker run -d -p 8080:8080 tsl/api +``` then go to localhost:8080. note that this only works with port 8080 to deploy +``` docker build -t tsl/api . gcloud builds submit --tag gcr.io/tslapi-2/tsl --timeout=1h gcloud run deploy graphviz-web --image gcr.io/tslapi-2/tsl +``` you need to set a longer time out since it takes so long to build (30 min maybe?). diff --git a/docs/index.html b/docs/index.html index 5dd4f64..d313450 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,9 +12,13 @@ function callSynth() { let tslSpec = document.getElementById("specBox").value; let targetLang = document.getElementById("targetLang").value; - $.post("https://graphviz-web-vvxsiayuzq-ue.a.run.app/tslsynth", {tsl: tslSpec, target: targetLang, id: userID}, function(data){ + $.post("https://graphviz-web-vvxsiayuzq-ue.a.run.app/tslsynth", {tsl: tslSpec, target: targetLang}, function(data){ document.getElementById("codeBox").value = data; - }); + }) + .fail(function(response) { + document.getElementById("codeBox").value = response.responseText; + }); + }