From 40321ca82e2a9eff21f82585928ea27695dfaaba Mon Sep 17 00:00:00 2001 From: K-dash Date: Fri, 31 May 2024 20:25:39 +0900 Subject: [PATCH] Enable hot reload for development server --- .pre-commit-config.yaml | 2 +- src/server.py | 2 +- src/settings.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e90f7a..530c7fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: hooks: # Run the linter. - id: ruff - args: [ ., --fix, --diff ] + entry: ruff check . --fix # Run the formatter. - id: ruff-format args: [ . ] diff --git a/src/server.py b/src/server.py index bc06cd9..d14fb1b 100644 --- a/src/server.py +++ b/src/server.py @@ -79,4 +79,4 @@ async def run_subprocess(): if __name__ == "__main__": - app.run(host="0.0.0.0", port=env.PORT) + app.run(host="0.0.0.0", port=env.PORT, debug=env.DEBUG) diff --git a/src/settings.py b/src/settings.py index d9087f5..b7e7660 100644 --- a/src/settings.py +++ b/src/settings.py @@ -28,6 +28,7 @@ class ServerSettings(CommonSettings): IP_ADDRESS: Union[IPvAnyAddress | Literal["localhost"]] = Field( default="localhost" ) + DEBUG: bool = Field(default=True) class EmailSettings(ServerSettings):