Source: factory.web/WebServer.py
| Method | Signature | Description |
|---|---|---|
| set_token | set_token(token) |
|
| set_token_group | set_token_group(token) |
|
| set_agent | set_agent(user_agent, host) |
|
| add_content | add_content(template, content) |
|
| connect_redis | connect_redis() |
|
| render_resource_script | render_resource_script(template) |
|
| render_resource_css | render_resource_css(template) |
|
| parse_headers | parse_headers(query_params = '') |
|
| parse_params | parse_params(query_params) |
|
| parse_payload | parse_payload(type = '', payload = '', external_guid = '') |
|
| get_string | get_string(key = '') |
|
| emerge_report | emerge_report(report_codes) |
|
| get_template | get_template(template = 'default', site_url = '') -> Union[str, tuple] |
|
| render_template | render_template(template: dict, session_user: str = '', context: str = '', param1: str = '', param2: str = '', param3: str = '') -> str |
|
| clear_template | clear_template(html_content = '') |
|
| render_template_jinja | render_template_jinja(template: dict, session_user: str = '', context: str = '', param1: str = '', param2: str = '', param3: str = '') -> tuple |
Render a page using Jinja2 template inheritance. |
| process_webhook | process_webhook(context = '', external_guid = '') |
|
| render_webhook_result | render_webhook_result() |
| Method | Signature | Description |
|---|---|---|
| body | async body() -> bytes |
| Method | Signature | Description |
|---|---|---|
| get_route_handler | get_route_handler() -> Callable |
StaticFiles with Cache-Control headers.
DEV: 60s, UAT: 300s, PROD: 86400s (1 day).
Fonts and sounds get longer TTLs since they
rarely change.
| Method | Signature | Description |
|---|---|---|
| get_response | async get_response(path, scope) |
Get the global ACL instance, initializing it on first access.
In production this will be directed to a log file
Extract real client IP from request.
Serve documents with per-document caching.