mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-03-06 10:00:39 +03:00
refactor: update logger import paths to use app.services.logging
This commit is contained in:
19
app/server.py
Normal file
19
app/server.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from granian import Granian
|
||||
|
||||
def startup():
|
||||
print("Server starting up...")
|
||||
|
||||
def shutdown():
|
||||
print("Server shutting down...")
|
||||
|
||||
server = Granian(
|
||||
"main:app",
|
||||
host="0.0.0.0", # Bind to all interfaces
|
||||
port=8000,
|
||||
workers=4,
|
||||
interface="asgi",
|
||||
blocking_threads=8 # Optional: threads per worker for blocking ops
|
||||
)
|
||||
server.on_startup(startup)
|
||||
server.on_shutdown(shutdown)
|
||||
server.serve_forever()
|
||||
Reference in New Issue
Block a user