{"id":17030052,"url":"https://github.com/rob-blackbourn/bareasgi-static","last_synced_at":"2025-03-22T20:24:49.070Z","repository":{"id":34050284,"uuid":"167529263","full_name":"rob-blackbourn/bareASGI-static","owner":"rob-blackbourn","description":"Static file support for bareasgi","archived":false,"fork":false,"pushed_at":"2022-08-23T12:30:57.000Z","size":1521,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T12:19:18.927Z","etag":null,"topics":["asgi","asyncio","bareasgi","python","static-files","web"],"latest_commit_sha":null,"homepage":"https://rob-blackbourn.github.io/bareASGI-static/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rob-blackbourn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-25T10:23:47.000Z","updated_at":"2021-10-04T06:33:00.000Z","dependencies_parsed_at":"2022-08-09T09:40:39.213Z","dependency_job_id":null,"html_url":"https://github.com/rob-blackbourn/bareASGI-static","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2FbareASGI-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2FbareASGI-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2FbareASGI-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2FbareASGI-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rob-blackbourn","download_url":"https://codeload.github.com/rob-blackbourn/bareASGI-static/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245015820,"owners_count":20547478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asgi","asyncio","bareasgi","python","static-files","web"],"created_at":"2024-10-14T08:03:49.951Z","updated_at":"2025-03-22T20:24:49.047Z","avatar_url":"https://github.com/rob-blackbourn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bareasgi-static\n\nStatic file support for [bareASGI](http://github.com/rob-blackbourn/bareasgi) (read the [documentation](https://rob-blackbourn.github.io/bareASGI-static/))\n\n## Overview\n\nThis package provides support for serving static files to bareasgi.\n\n## Usage\n\nThe following example serves a single file.\n\n```python\nimport uvicorn\nimport os.path\nfrom bareasgi import Application\nfrom bareasgi_static import file_response\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\nasync def http_request_callback(request):\n    return await file_response(request, 200, os.path.join(here, 'file_stream.html'))\n\napp = Application()\napp.http_router.add({'GET'}, '/example1', http_request_callback)\n\nuvicorn.run(app, port=9010)\n\n```\n\nThe next example serves files below a given directory.\n\n```python\nimport os.path\nimport uvicorn\nfrom bareasgi import Application\nfrom bareasgi_static import add_static_file_provider\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\napp = Application()\nadd_static_file_provider(app, os.path.join(here, simple_www), index_filename='index.html')\n\nuvicorn.run(app, port=9010)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-blackbourn%2Fbareasgi-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob-blackbourn%2Fbareasgi-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-blackbourn%2Fbareasgi-static/lists"}