Skip to content

add Module-based Views example#386

Merged
nggit merged 2 commits intomainfrom
mbv
Feb 11, 2026
Merged

add Module-based Views example#386
nggit merged 2 commits intomainfrom
mbv

Conversation

@nggit
Copy link
Owner

@nggit nggit commented Jan 31, 2026

Maps URLs to module names and methods.

This PR adds this hidden feature in examples.

from tremolo import Application
from utils import add_package

app = Application()

# http://localhost:8000/fruits       -> fruits.get()
# http://localhost:8000/fruits/apple -> fruits.apple.get()
add_package('fruits', app)

if __name__ == '__main__':
    app.run('0.0.0.0', 8000)

@sonarqubecloud
Copy link

@nggit nggit merged commit baaff7b into main Feb 11, 2026
23 checks passed
@nggit nggit deleted the mbv branch February 11, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant