(directory: Path)
| 5 | |
| 6 | |
| 7 | def create_simple_server(directory: Path): |
| 8 | if not directory.is_dir(): |
| 9 | raise SanicException( |
| 10 | "Cannot setup Sanic Simple Server without a path to a directory" |
| 11 | ) |
| 12 | |
| 13 | app = Sanic("SimpleServer") |
| 14 | app.static( |
| 15 | "/", directory, name="main", directory_view=True, index="index.html" |
| 16 | ) |
| 17 | |
| 18 | return app |
no test coverage detected
searching dependent graphs…