Skip to main content

bareasgi-static

Static file support for bareASGI (read the documentation)

Overview

This package provides support for serving static files to bareasgi.

Usage

The following example serves a single file.

import uvicorn
import os.path
from bareasgi import Application
from bareasgi_static import file_response

here = os.path.abspath(os.path.dirname(__file__))

async def http_request_callback(request):
    return await file_response(request, 200, os.path.join(here, 'file_stream.html'))

app = Application()
app.http_router.add({'GET'}, '/example1', http_request_callback)

uvicorn.run(app, port=9010)

The next example serves files below a given directory.

import os.path
import uvicorn
from bareasgi import Application
from bareasgi_static import add_static_file_provider

here = os.path.abspath(os.path.dirname(__file__))

app = Application()
add_static_file_provider(app, os.path.join(here, simple_www), index_filename='index.html')

uvicorn.run(app, port=9010)

Metadata

Release files for bareASGI-static 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bareASGI-static 5.0.0
File Size Uploaded Provenance Actions
bareasgi_static-5.0.0.tar.gz 9.9 kB Without provenance Details for bareasgi_static-5.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bareASGI-static 5.0.0
File Interpreter ABI Platform Actions
bareasgi_static-5.0.0-py3-none-any.whl Python 3 none any Details for bareasgi_static-5.0.0-py3-none-any.whl

Total release size: 20.0 kB

Release files / bareasgi_static-5.0.0.tar.gz

Download URL bareasgi_static-5.0.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
abfdf0ab2ce646c11b29af168fe0fba81e70396922473cbcbf00b5a4291dab28
BLAKE2b-256 checksum
How to use checksums
ddd8ded8a230f32c5a16e7b591376f2926111aa4656345b2d4247eb7a9f8887e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / bareasgi_static-5.0.0-py3-none-any.whl

Download URL bareasgi_static-5.0.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b7712e9f3bf2e8d243c8c7d49e012a795f08ac89e6d2ecebd2058af2a998600
BLAKE2b-256 checksum
How to use checksums
78914587548bd1f65868f0c14487f10056e6d6089f4ae7bfbdca90ce9b4b94fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for bareASGI-static 5.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page