add support for CORS headers

Adds the additional dependency to sanic-cors for the Sanic server.
This commit is contained in:
Sarah Hoffmann
2023-01-24 21:26:32 +01:00
parent 654b652530
commit e490a30a4a
7 changed files with 21 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ def get_application(project_dir: Path,
"""
api = NominatimAPIAsync(project_dir, environ)
app = App()
app = App(cors_enable=api.config.get_bool('CORS_NOACCESSCONTROL'))
for name, func in api_impl.ROUTES:
app.add_route('/' + name, EndpointWrapper(func, api))