-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
349fe6f
commit da75a1b
Showing
1 changed file
with
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Pods | ||
|
||
The core of Wheke's modularity lies on the `Pod` class. | ||
|
||
Once you have your code ready you can bundle it in a Pod to be plugged in Wheke: | ||
|
||
```python hl_lines="12 15" | ||
from fastapi import APIRouter | ||
from wheke import Pod, Wheke | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get("/hello") | ||
def hello() -> dict: | ||
return {"hello": "world"} | ||
|
||
|
||
my_pod = Pod("my-pod", router=router) # Create the pod | ||
|
||
wheke = Wheke() | ||
wheke.add_pod(my_pod) # Add the pod to wheke | ||
|
||
app = wheke.create_app() | ||
``` | ||
|
||
## Ready to use Pods | ||
|
||
Pods can be developed and published as a package for other to use. | ||
|
||
These are examples of pods that offer ready to use functionalities: | ||
|
||
- [wheke-auth](https://github.com/humrochagf/wheke-auth): A Pod that adds auth to Wheke. |