slash package
Slash is a framework for web applications.
- class slash.App(host='127.0.0.1', port=8080, *, ssl_context=None, enable_upload=True, max_upload_size=10000000, debug=False)
Bases:
objectMain class for a Slash web application.
- Parameters:
host (str) – Hostname on which to serve the web server.
port (int) – Port on which to serve the web server.
ssl_context (SSLContext | None) – SSL context to use for the web server.
enable_upload (bool) – Boolean flag indicating whether file upload is enabled.
max_upload_size (int) – Maximum file size for uploaded files in bytes.
debug (bool) – Flag indicating whether debug information is logged.
- add_route(pattern, root)
Add route from a path pattern.
- Parameters:
pattern (str) – String or regex pattern to match the path of the URL.
root (Callable[[...], Elem]) – Function that returns the root element of the page. If pattern is a
re.Pattern, the matched groups will be provided to the function as arguments.
- Return type:
None
- run()
Run the application.
- Return type:
None