Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for mount (0.19 sec)

  1. docs_src/static_files/tutorial001.py

    from fastapi import FastAPI
    from fastapi.staticfiles import StaticFiles
    
    app = FastAPI()
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 159 bytes
    - Viewed (0)
  2. docs_src/sub_applications/tutorial001.py

    @app.get("/app")
    def read_main():
        return {"message": "Hello World from main app"}
    
    
    subapi = FastAPI()
    
    
    @subapi.get("/sub")
    def read_sub():
        return {"message": "Hello World from sub API"}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 11 21:53:19 GMT 2020
    - 274 bytes
    - Viewed (0)
  3. docs_src/wsgi/tutorial001.py

        name = request.args.get("name", "World")
        return f"Hello, {escape(name)} from Flask!"
    
    
    app = FastAPI()
    
    
    @app.get("/v2")
    def read_main():
        return {"message": "Hello World"}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue May 09 14:32:00 GMT 2023
    - 443 bytes
    - Viewed (0)
  4. docs_src/templates/tutorial001.py

    from fastapi import FastAPI, Request
    from fastapi.responses import HTMLResponse
    from fastapi.staticfiles import StaticFiles
    from fastapi.templating import Jinja2Templates
    
    app = FastAPI()
    
    app.mount("/static", StaticFiles(directory="static"), name="static")
    
    
    templates = Jinja2Templates(directory="templates")
    
    
    @app.get("/items/{id}", response_class=HTMLResponse)
    async def read_item(request: Request, id: str):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Dec 26 20:12:34 GMT 2023
    - 521 bytes
    - Viewed (0)
  5. docs_src/custom_docs_ui/tutorial002.py

    from fastapi.openapi.docs import (
        get_redoc_html,
        get_swagger_ui_html,
        get_swagger_ui_oauth2_redirect_html,
    )
    from fastapi.staticfiles import StaticFiles
    
    app = FastAPI(docs_url=None, redoc_url=None)
    
    app.mount("/static", StaticFiles(directory="static"), name="static")
    
    
    @app.get("/docs", include_in_schema=False)
    async def custom_swagger_ui_html():
        return get_swagger_ui_html(
            openapi_url=app.openapi_url,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  6. tests/test_jsonable_encoder.py

    def test_encode_dataclass():
        item = Item(name="foo", count=100)
        assert jsonable_encoder(item) == {"name": "foo", "count": 100}
        assert jsonable_encoder(item, include={"name"}) == {"name": "foo"}
        assert jsonable_encoder(item, exclude={"count"}) == {"name": "foo"}
        assert jsonable_encoder(item, include={}) == {}
        assert jsonable_encoder(item, exclude={}) == {"name": "foo", "count": 100}
    
    
    def test_encode_unsupported():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  7. scripts/docs.py

        """
        update_languages()
        shutil.rmtree(site_path, ignore_errors=True)
        langs = [lang.name for lang in get_lang_paths() if lang.is_dir()]
        cpu_count = os.cpu_count() or 1
        process_pool_size = cpu_count * 4
        typer.echo(f"Using process pool size: {process_pool_size}")
        with Pool(process_pool_size) as p:
            p.map(build_lang, langs)
    
    
    @app.command()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  8. fastapi/routing.py

    from starlette.routing import (
        BaseRoute,
        Match,
        compile_path,
        get_name,
        request_response,
        websocket_session,
    )
    from starlette.routing import Mount as Mount  # noqa
    from starlette.types import ASGIApp, Lifespan, Scope
    from starlette.websockets import WebSocket
    from typing_extensions import Annotated, Doc, deprecated
    
    
    def _prepare_response_content(
        res: Any,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  9. tests/test_dependency_cache.py

    
    async def super_dep(count: int = Depends(dep_counter)):
        return count
    
    
    @app.get("/counter/")
    async def get_counter(count: int = Depends(dep_counter)):
        return {"counter": count}
    
    
    @app.get("/sub-counter/")
    async def get_sub_counter(
        subcount: int = Depends(super_dep), count: int = Depends(dep_counter)
    ):
        return {"counter": count, "subcounter": subcount}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Aug 23 13:30:24 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  10. .github/actions/people/app/main.py

        skip_users: Container[str],
        min_count: int = 2,
    ):
        users = []
        for commenter, count in counter.most_common(50):
            if commenter in skip_users:
                continue
            if count >= min_count:
                author = authors[commenter]
                users.append(
                    {
                        "login": commenter,
                        "count": count,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
Back to top