Skip to content

Commit 78a202b

Browse files
authored
Merge pull request #21 from pyscript/better-worker-path
Better worker.py path for GitHub pages
2 parents e65b05f + dfab277 commit 78a202b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/pubsub.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# LTK - Copyright 2024 - All Rights Reserved - chrislaffra.com - See LICENSE
1+
# LTK - Copyright 2024 - All Rights Reserved - chrislaffra.com - See LICENSE
22

33
import ltk
44
import random
55
from polyscript import XWorker
66

77
# Workers only work when server sets CORS, COOP, COEP headers
88
# See https://jeff.glass/post/whats-new-pyscript-2023-11-1/ for more details
9-
worker = XWorker("/examples/worker.py", config="/examples/worker.toml", type="micropython")
9+
worker = XWorker("./examples/worker.py", config="./examples/worker.toml", type="micropython")
1010

1111
fan = ltk.Preformatted("")
1212

@@ -20,12 +20,12 @@
2020
def publish(event=None):
2121
message = random.choice([
2222
"Subscribe!\n", "Like!\n", "Share!\n", "Pay me!\n", "Repost!\n"
23-
])
23+
])
2424
ltk.publish(
2525
"Influencer", # the sender
2626
"Fan", # the intended receiver
2727
"message", # the subscription topic
28-
message # the message to send
28+
message # the message to send
2929
)
3030

3131
def create():

0 commit comments

Comments
 (0)