Skip to content

Commit 8368917

Browse files
committed
add static assets to example
Signed-off-by: Joel Dice <[email protected]>
1 parent 91dae41 commit 8368917

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

py/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ def handle_request(request):
1616
baz = "wow"
1717
such = "toml"
1818
"""
19-
2019
print(f"And here's some TOML: {toml.loads(some_toml)}")
2120

21+
my_file = open("/foo.txt", "r")
22+
print(f"And here's the contents of foo.txt: {my_file.read()}")
23+
2224
response = http_send(Request("GET", "https://some-random-api.ml/facts/dog", [], None))
2325
print(f"Got dog fact: {str(response.body, 'utf-8')}")
2426

spin.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ version = "0.1.0"
99
id = "spin-webrtc"
1010
environment = { hello = "teapot" }
1111
config = { redis_address = "redis://127.0.0.1:6379" }
12+
files = [{ source = "static-assets/", destination = "/" }]
1213
source = "target/wasm32-wasi/release/python-wasi-vfs-wizer.wasm"
1314
allowed_http_hosts = ["insecure:allow-all"]
1415
[component.trigger]

static-assets/foo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jabberwocky

0 commit comments

Comments
 (0)