コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 5 of about 5 for prefix (0.001 sec.)
Behind a Proxy 12207
Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration ... that adds an extra path prefix that is not seen by your application. In these cases you can use root_path to configure your application. The root_path is ... d to handle these specific cases. And it's also used internally when mounting sub-applications. Proxy with a stripped path prefix Having a proxy with a stripped path prefix, in this case, means that you could declare a path at /app in your code, but th ... essage" : "Hello World" , "root_path" : request . scope . get ( "root_path" )} And the proxy would be "stripping" the path prefix on the fly before transmitting the request to the app server (probably Uvicorn via FastAPI CLI), keeping your application ...
https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
Bigger Applications - Multiple Files 10424
Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you ... But we want to be smarter and simplify the code a bit. We know all the path operations in this module have the same: Path prefix : /items . tags : (just one tag: items ). Extra responses . dependencies : they all need that X-Token dependency we create ... y from fastapi import APIRouter , Depends , HTTPException from ..dependencies import get_token_header router = APIRouter ( prefix = "/items" , tags = [ "items" ], dependencies = [ Depends ( get_token_header )], responses = { 404 : { "description" : "No ... peration has to start with / , like in: @router . get ( "/ {item_id} " ) async def read_item ( item_id : str ): ... ...the prefix must not include a final / . So, the prefix in this case is /items . We can also add a list of tags and extra responses th ...
https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
Sub Applications - Mounts 7997
Sub Applications - Mounts Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you need to have two independent FastAPI applications, with their own independent Open ... ee the automatic API docs for the sub-application, including only its own path operations , all under the correct sub-path prefix /subapi : If you try interacting with any of the two user interfaces, they will work correctly, because the browser will b ... sing a mechanism from the ASGI specification called a root_path . That way, the sub-application will know to use that path prefix for the docs UI. And the sub-application could also have its own mounted sub-applications and everything would work correc ...
https://man.mtool.work/fastapi/0.115/advanced/sub-applications/
Response Headers 7629
Response Headers Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Use a Response parameter You can declare a parameter of type Response in your path operation funct ... provides it at fastapi.Response . Custom Headers Keep in mind that custom proprietary headers can be added using the 'X-' prefix . But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS ...
https://man.mtool.work/fastapi/0.115/advanced/response-headers/
GraphQL 7629
GraphQL Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . As FastAPI is based on the ASGI standard, it's very easy to integrate any GraphQL library also compatible w ... ry . Schema ( query = Query ) graphql_app = GraphQLRouter ( schema ) app = FastAPI () app . include_router ( graphql_app , prefix = "/graphql" ) You can learn more about Strawberry in the Strawberry documentation . And also the docs about Strawberry wi ...
https://man.mtool.work/fastapi/0.115/how-to/graphql/
PREV 1 NEXT