feat(__main__.py): add optional static_files_dir parameter to setup_app function

The variable name static_files_dir was changed to improve semantics. It is now more clear that it is a directory path. An optional static_files_dir parameter was added to the setup_app function to allow for a directory path to be passed in. This allows for more flexibility in serving static files.
🐛 fix(__main__.py): fix static_files_dir variable name to improve semantics
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-27 11:09:26 -03:00
commit 93c3f7a2a6

View file

@ -142,8 +142,8 @@ def serve(
cache=cache,
)
# create path object if path is provided
path = Path(path) if path else path
app = setup_app(static_files_dir=path)
static_files_dir: Optional[Path] = Path(path) if path else None
app = setup_app(static_files_dir=static_files_dir)
# check if port is being used
if is_port_in_use(port, host):
port = get_free_port(port)