+
+ async def on_get(self, req: Request, resp: Response) -> None:
+ """ Implementation of the endpoint.
+ """
+ await self.func(self.api, ParamWrapper(req, resp, self.api.config))
+
+
+def get_application(project_dir: Path,
+ environ: Optional[Mapping[str, str]] = None) -> App:
+ """ Create a Nominatim Falcon ASGI application.
+ """
+ api = NominatimAPIAsync(project_dir, environ)
+
+ app = App(cors_enable=api.config.get_bool('CORS_NOACCESSCONTROL'))
+ app.add_error_handler(HTTPNominatimError, nominatim_error_handler)
+
+ legacy_urls = api.config.get_bool('SERVE_LEGACY_URLS')
+ for name, func in api_impl.ROUTES:
+ endpoint = EndpointWrapper(func, api)
+ app.add_route(f"/{name}", endpoint)
+ if legacy_urls:
+ app.add_route(f"/{name}.php", endpoint)