Coverage for src/lexigram/web/static/provider.py: 50%

8 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-25 04:37 +0800

1from __future__ import annotations 

2 

3 

4class StaticFileProvider: 

5 """Provider for static file serving configuration.""" 

6 

7 def __init__( 

8 self, 

9 directory: str = "static", 

10 prefix: str = "/static", 

11 html: bool = False, 

12 ) -> None: 

13 self.directory = directory 

14 self.prefix = prefix 

15 self.html = html 

16 

17 def create_middleware(self) -> dict: 

18 """Create the static files middleware configuration.""" 

19 return { 

20 "directory": self.directory, 

21 "prefix": self.prefix, 

22 "html": self.html, 

23 }