Add configurable adapter selection to app runner
This commit is contained in:
15
README.md
15
README.md
@@ -5,12 +5,27 @@ default v2 app run:
|
||||
python3 ./youdis.py
|
||||
```
|
||||
|
||||
`youdis.py` is the app-level runner. It starts the backend first, waits for health, then starts each enabled adapter explicitly.
|
||||
|
||||
direct component runs still work for testing:
|
||||
```
|
||||
python3 -m uvicorn youdis.main:app --host 127.0.0.1 --port 8000
|
||||
python3 -m youdis.adapters.discord
|
||||
```
|
||||
|
||||
adapter selection is controlled by env, currently:
|
||||
```
|
||||
YOUDIS_RUN_BACKEND=1
|
||||
YOUDIS_ENABLED_ADAPTERS=discord
|
||||
```
|
||||
|
||||
to add a new adapter:
|
||||
1. add `youdis/adapters/<adapter>.py`
|
||||
2. make it independently runnable
|
||||
3. add `start_<adapter>()` to `youdis.py`
|
||||
4. register it in the explicit adapter starter map in `youdis.py`
|
||||
5. add any required env vars to `.env.example`
|
||||
|
||||
build and run the docker container
|
||||
```
|
||||
DISCORD_BOT_TOKEN = [discord bot token]
|
||||
|
||||
Reference in New Issue
Block a user