File size: 804 Bytes
e3e7994
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""FastAPI / Gradio Server entry point.

Provides `create_app()` which returns the configured `gradio.Server` instance
with all HTTP routes and Gradio API endpoints registered.

The actual routes are defined in `code/server/routes.py`.
"""

from __future__ import annotations

from typing import Any


def create_app() -> Any:
    """Create and return the configured Gradio Server app instance.

    This is a thin wrapper around `code.server.routes.get_app()` that
    triggers all the route decorators when the routes module is first
    imported.
    """
    from code.server.routes import get_app  # noqa: F401  (import has side effects)

    return get_app()


def get_app() -> Any:
    """Backward-compatible alias for create_app()."""
    return create_app()


__all__ = ["create_app", "get_app"]