Allow for uvicorn reload option for development workflow
It would be nice to run the server in reload mode for debugging. It is possible to do this with FastAPI and uvicorn with the uvicorn --reload option. It is possible to send uvicorn this option via the config.yml as follows:
uvicorn:
reload: true
However, tiled serve is not setup correctly to allow for this to work. Here is the error returned when uvicorn:reload:true:
[-] WARNING: You must pass the application as an import string to enable 'reload' or 'workers'.
Looking at the tiled.commandline._serve file, this may be more complex to change, due to the creation of the custom web_app object being dynamically generated with build_app rather than a direct import
Actually, this can work. You have to use a config file, as there is no way to route CLI args to tiled (they go to uvicorn):
TILED_CONFIG=... uvicorn tiled.server.app:app
The app object uses module __getattr__ to dynamically build an app instance.