Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions frameworks/Python/clace/app.star
Original file line number Diff line number Diff line change
@@ -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)
]
)
10 changes: 8 additions & 2 deletions frameworks/Python/clace/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ cat <<EOF > /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
Loading