File: README.md

package info (click to toggle)
python-hug 2.6.0-2.4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,072 kB
  • sloc: python: 8,938; sh: 99; makefile: 17
file content (9 lines) | stat: -rw-r--r-- 389 bytes parent folder | download
1
2
3
4
5
6
7
8
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`