Beispiel #1
0
 def _serve(cls, content: str, js_resources: Dict[str, str]) -> str:
     if cls._provider is None:
         cls._provider = Provider()
     resource = cls._provider.create(
         content=content, route="", headers={"Access-Control-Allow-Origin": "*"},
     )
     cls._resources[resource.url] = resource
     for route, content in js_resources.items():
         cls._resources[route] = cls._provider.create(content=content, route=route,)
     return resource.url
def provider() -> Iterator[Provider]:
    provider = Provider()
    yield provider
    provider.stop()
Beispiel #3
0
def provider():
    provider = Provider()
    yield provider
    provider.stop()