ServiceDownloader
ClassSource
service = ServiceDownloader(
service_name: str = "/dfc-downloader",
allowed_cross_origin: str | None = None,
)
Service provider for optional features of the downloader.
This instance provides some optional features required by the implementation of the downloader. The services of this instance do not handle any downloadable data.
Aliases
This class can be acquired by
import dash_file_cache as dfc
dfc.ServiceDownloader
dfc.services.ServiceDownloader
dfc.services.downloader.ServiceDownloader
Arguments
Argument | Type | Required | |
---|---|---|---|
service_name | str | The name of this service. | |
allowed_cross_origin | str | None | The allowed cross origin when serving the data. The usage should be the same as "Access-Control-Allow-Origin" . If this value is empty or None , the cross-origin will not be configured. |
Methods
serve
service.serve(app: dash.Dash | flask.Flask, endpoint: str | None = None)
Add the service to the Flask application.
Requires
Argument | Type | Required | |
---|---|---|---|
app | dash.Dash | flask.Flask | The application where the services will be bound. | |
endpoint | str | None | The endpoint of this serivce. If not specified, will use the service address to infer it. |
Properties
allowed_cross_origin
allowed_cross_origin: str = service.allowed_cross_origin
The allowed cross origin. If this value is an empty string, the cross-origin data delivery will not be used.
Examples
See