Framework uses Uvicorn and serves the app in the root path i.e.Documentation Index
Fetch the complete documentation index at: https://dev.writer.com/llms.txt
Use this file to discover all available pages before exploring further.
/. If you need to use another ASGI-compatible server or fine-tune Uvicorn, you can easily do so.
Configure webserver
You can tune your server by adding aserver_setup.py file to the root
of your application, next to the main.py files.
This file is executed before starting writer. It allows you to configure authentication,
add your own routes and middlewares on FastAPI.
Implement custom server
You can importwriter.serve and use the function get_asgi_app. This returns an ASGI app created by FastAPI, which you can choose how to serve.
The following code can serve as a starting point. You can save this code as serve.py and run it with python serve.py.
ws_max_size setting. This is important for normal functioning of the framework when dealing with bigger files.
Fine-tuning Uvicorn allows you to set up SSL, configure proxy headers, etc, which can prove vital in complex deployments.
If you want to disable server setup hook, you should use enable_server_setup:
Multiple apps at once
Framework is built using relative paths, so it can be served from any path. This allows multiple apps to be simultaneously served on different paths. The example below uses theget_asgi_app function to obtain two separate Framework apps, which are then mounted on different paths, /app1 and /app2, of a FastAPI app.