From 18a1b2e9c27fec99cb4de37470f10fd4236f63ca Mon Sep 17 00:00:00 2001 From: Ajay Kidave Date: Fri, 24 Jan 2025 12:47:58 -0800 Subject: [PATCH 1/2] Added localhost path --- frameworks/Python/clace/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/Python/clace/run.sh b/frameworks/Python/clace/run.sh index d5dc87d345e..311de74eaed 100755 --- a/frameworks/Python/clace/run.sh +++ b/frameworks/Python/clace/run.sh @@ -15,5 +15,6 @@ EOF clace server start & sleep 2 +clace app create --auth=none --approve /clace / clace app create --auth=none --approve /clace tfb-server:/ tail -f /dev/null From 0e1175be3843bd0fa982df1f34f6e3b3873939b6 Mon Sep 17 00:00:00 2001 From: Ajay Kidave Date: Tue, 22 Apr 2025 14:42:01 -0700 Subject: [PATCH 2/2] [clace] - Changed to use no_args handlers --- frameworks/Python/clace/app.star | 10 ++++++++-- frameworks/Python/clace/run.sh | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frameworks/Python/clace/app.star b/frameworks/Python/clace/app.star index 86c0dd68346..017235a9da9 100644 --- a/frameworks/Python/clace/app.star +++ b/frameworks/Python/clace/app.star @@ -1,6 +1,12 @@ +def json_no_args(): + return {'message': 'Hello, world!'} + +def text_no_args(): + return 'Hello, world!' + app = ace.app("testapp", routes = [ - ace.api("/json", lambda req: {'message': 'Hello, world!'}, type=ace.JSON), - ace.api("/plaintext", lambda req: 'Hello, world!', type=ace.TEXT) + ace.api("/json", type=ace.JSON, handler=json_no_args), + ace.api("/plaintext", type=ace.TEXT, handler=text_no_args) ] ) diff --git a/frameworks/Python/clace/run.sh b/frameworks/Python/clace/run.sh index 311de74eaed..e50158afcc5 100755 --- a/frameworks/Python/clace/run.sh +++ b/frameworks/Python/clace/run.sh @@ -6,15 +6,21 @@ cat < /root/clhome/clace.toml console = false file = false access_logging = false +level = "WARN" [http] -host = "0.0.0.0" +host = "" port = 8080 + +[system] +enable_compression = false + +[app_config] +cors.allow_origin = "" EOF clace server start & sleep 2 clace app create --auth=none --approve /clace / -clace app create --auth=none --approve /clace tfb-server:/ tail -f /dev/null