main.py 338 B

1234567891011121314151617
  1. import os
  2. from nicegui import app, ui
  3. @ui.page('/')
  4. def index():
  5. ui.textarea('This note is kept between visits') \
  6. .classes('w-96').bind_value(app.storage.user, 'note')
  7. def handle_shutdown():
  8. print('Shutdown has been initiated!')
  9. app.on_shutdown(handle_shutdown)
  10. ui.run(storage_secret=os.environ['STORAGE_SECRET'])