-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #740 from akaihola/multiple_files-example-document…
…ation Added documentation for the `multiple_files` example
- Loading branch information
Showing
6 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Splitting the API into multiple files | ||
|
||
Example of an API defined in multiple Python modules and combined together | ||
using the `extend_api()` helper. | ||
|
||
Run with `hug -f api.py`. There are three API endpoints: | ||
- `http://localhost:8000/` – `say_hi()` from `api.py` | ||
- `http://localhost:8000/part1` – `part1()` from `part_1.py` | ||
- `http://localhost:8000/part2` – `part2()` from `part_2.py` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
|
||
@hug.get() | ||
def part1(): | ||
"""This view will be at the path ``/part1``""" | ||
return 'part1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
|
||
@hug.get() | ||
def part2(): | ||
"""This view will be at the path ``/part2``""" | ||
return 'Part 2' |