API¶
function bareasgi_static.static_files_provider.add_static_file_provider ¶
Summary¶
Add static file support.
Parameters¶
app: ApplicationThe bareASGI application.
Where to find the files to serve.
Where the files should appear on the url. Defaults to '/'.
If True check the source folder exists. Defaults to True.
An optional index file name. Defaults to None.
The headers. Defaults to None.
class StaticFilesProvider ¶
Summary¶
A static file provider.
Parameters¶
source_folder: strWhere to find the files to serve.
A path variable to capture the mount point. Defaults to None.
If True check the source folder exists. Defaults to True.
An optional index file name. Defaults to None.
The headers. Defaults to None.
async function bareasgi_static.file_streaming.file_response ¶
Summary¶
A utility method to create a file response.
Parameters¶
request: HttpRequestThe HTTP status code.
The path to the file.
The headers. Defaults to None.
The content type.. Defaults to None.
The filename. Defaults to None.
If True check for modifications to the file. Defaults to False.
async generator function bareasgi_static.file_streaming.file_writer ¶
Summary¶
Creates an async iterator to write a file.
Parameters¶
path: strThe path of the file to write.
The size of each block. Defaults to CHUNK_SIZE.