Skip to content
Discussion options

You must be logged in to vote

Try this:

from nicegui import app, ui

app.add_static_files(url_path="/files", local_directory='./')

@ui.page('/')
@ui.page('/{_:path}')
def main_page():
    pass

if __name__ in {'__main__', '__mp_main__'}: 
    ui.run(storage_secret='demo_secret_key_change_in_production')

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@quartelmestre
Comment options

@python-and-novella
Comment options

@evnchn
Comment options

evnchn Jun 20, 2026
Collaborator

Answer selected by quartelmestre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants