+def _wrap_endpoint(func: api_impl.EndpointFunc)\
+ -> Callable[[Request], Coroutine[Any, Any, HTTPResponse]]:
+ async def _callback(request: Request) -> HTTPResponse:
+ return cast(HTTPResponse, await func(request.app.ctx.api, ParamWrapper(request)))
+
+ return _callback
+
+
+def get_application(project_dir: Path,
+ environ: Optional[Mapping[str, str]] = None) -> Sanic:
+ """ Create a Nominatim sanic ASGI application.
+ """
+ app = Sanic("NominatimInstance")