sok.server.app
The FastAPI application of S.O.K Server, and its entry point (sok-server).
The database is sok.db in data_dir() (SOK_CONFIG_DIR, /config in the image). The server listens on SOK_HOST (0.0.0.0) and SOK_PORT (8080).
Functions
configure_logging
def configure_logging() -> None:Log to the console and to logs/sok.log of the config folder.
Sourcecreate_app
def create_app(folder: Optional[Path] = None) -> FastAPI:Create the application.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
folder | Optional[Path] | None | Folder of the database; data_dir() by default. |
main
def main() -> None:Run the server (the sok-server command, and the Docker image).
SourceAttributes
| Name | Value |
|---|---|
DEFAULT_PORT | 8080 |
logger | logging.getLogger(__name__) |