serve() — fastapi Function Reference
Architecture documentation for the serve() function in docs.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 83e300d5_cb80_9ae9_5ff4_d2db0f895aae["serve()"] 089911a1_02c3_0f6b_d62d_71c980ade67e["docs.py"] 83e300d5_cb80_9ae9_5ff4_d2db0f895aae -->|defined in| 089911a1_02c3_0f6b_d62d_71c980ade67e 1ee508b4_5541_8908_952c_808cdb906c5e["live()"] 83e300d5_cb80_9ae9_5ff4_d2db0f895aae -->|calls| 1ee508b4_5541_8908_952c_808cdb906c5e style 83e300d5_cb80_9ae9_5ff4_d2db0f895aae fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
scripts/docs.py lines 293–311
def serve() -> None:
"""
A quick server to preview a built site with translations.
For development, prefer the command live (or just mkdocs serve).
This is here only to preview a site with translations already built.
Make sure you run the build-all command first.
"""
typer.echo("Warning: this is a very simple server.")
typer.echo("For development, use the command live instead.")
typer.echo("This is here only to preview a site with translations already built.")
typer.echo("Make sure you run the build-all command first.")
os.chdir("site")
server_address = ("", 8008)
server = HTTPServer(server_address, SimpleHTTPRequestHandler)
typer.echo("Serving at: http://127.0.0.1:8008")
server.serve_forever()
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does serve() do?
serve() is a function in the fastapi codebase, defined in scripts/docs.py.
Where is serve() defined?
serve() is defined in scripts/docs.py at line 293.
What does serve() call?
serve() calls 1 function(s): live.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free