1
0

frontend.py 408 B

123456789101112131415161718
  1. from fastapi import FastAPI
  2. from nicegui import globals, ui
  3. def init(app: FastAPI) -> None:
  4. @ui.page('/show')
  5. def show():
  6. ui.label('Hello, FastAPI!')
  7. globals.title = 'FastAPI'
  8. globals.favicon = None
  9. globals.dark = False
  10. globals.binding_refresh_interval = 0.1
  11. globals.excludes = []
  12. globals.host = 'localhost'
  13. globals.port = 8000
  14. app.mount('/', globals.app)