You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,18 @@ from thimble import Thimble
16
16
17
17
app = Thimble()
18
18
19
-
@app.route('/')
19
+
@app.route("/")
20
20
defhello(req):
21
-
return'Hello World'
21
+
return"Hello World"
22
22
23
-
app.run()
23
+
@app.route("/gpio/<digit>")
24
+
defgpio(req, num):
25
+
returnf"Hello GPIO {num}"
26
+
27
+
app.run(debug=True)
24
28
```
25
29
26
-
Now, point your web browser to the IP of your device on the default port of 80 and you should see 'Hello World'.
30
+
Now, point your web browser to the IP of your device on the default port of 80 and you should see 'Hello World'. Using the URL path of _/gpio/2_ should return 'Hello GPIO 2'.
27
31
28
32
There are more complex examples in the [examples](https://github.com/DavesCodeMusings/thimble/examples) subdirectory.
0 commit comments