Skip to content

Commit 2696c98

Browse files
authored
[clace] - Changed to use no_args handlers (TechEmpower#9857)
* Added localhost path * [clace] - Changed to use no_args handlers
1 parent 9df59ea commit 2696c98

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

frameworks/Python/clace/app.star

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
def json_no_args():
2+
return {'message': 'Hello, world!'}
3+
4+
def text_no_args():
5+
return 'Hello, world!'
6+
17
app = ace.app("testapp",
28
routes = [
3-
ace.api("/json", lambda req: {'message': 'Hello, world!'}, type=ace.JSON),
4-
ace.api("/plaintext", lambda req: 'Hello, world!', type=ace.TEXT)
9+
ace.api("/json", type=ace.JSON, handler=json_no_args),
10+
ace.api("/plaintext", type=ace.TEXT, handler=text_no_args)
511
]
612
)

frameworks/Python/clace/run.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,21 @@ cat <<EOF > /root/clhome/clace.toml
66
console = false
77
file = false
88
access_logging = false
9+
level = "WARN"
910
1011
[http]
11-
host = "0.0.0.0"
12+
host = ""
1213
port = 8080
14+
15+
[system]
16+
enable_compression = false
17+
18+
[app_config]
19+
cors.allow_origin = ""
1320
EOF
1421

1522

1623
clace server start &
1724
sleep 2
1825
clace app create --auth=none --approve /clace /
19-
clace app create --auth=none --approve /clace tfb-server:/
2026
tail -f /dev/null

0 commit comments

Comments
 (0)