MCPcopy
hub / github.com/sanic-org/sanic / create_simple_server

Function create_simple_server

sanic/simple.py:7–18  ·  view source on GitHub ↗
(directory: Path)

Source from the content-addressed store, hash-verified

5
6
7def 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

Callers 1

loadMethod · 0.90

Calls 3

SanicExceptionClass · 0.90
SanicClass · 0.90
staticMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…