Skip to content

Commit 8930340

Browse files
README.md - demo wildcards in example
1 parent 0fcd175 commit 8930340

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ from thimble import Thimble
1616

1717
app = Thimble()
1818

19-
@app.route('/')
19+
@app.route("/")
2020
def hello(req):
21-
return 'Hello World'
21+
return "Hello World"
2222

23-
app.run()
23+
@app.route("/gpio/<digit>")
24+
def gpio(req, num):
25+
return f"Hello GPIO {num}"
26+
27+
app.run(debug=True)
2428
```
2529

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'.
2731

2832
There are more complex examples in the [examples](https://github.com/DavesCodeMusings/thimble/examples) subdirectory.
2933

0 commit comments

Comments
 (0)