mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 05:44:06 +00:00
allow to add php-compatible endpoints
If the new setting NOMINATIM_SERVE_LEGACY_URLS is set, the servers expose the endpoints also with the .php suffix to ensure backwards compatibility.
This commit is contained in:
@@ -66,7 +66,12 @@ def get_application(project_dir: Path,
|
||||
api = NominatimAPIAsync(project_dir, environ)
|
||||
|
||||
app = App(cors_enable=api.config.get_bool('CORS_NOACCESSCONTROL'))
|
||||
|
||||
legacy_urls = api.config.get_bool('SERVE_LEGACY_URLS')
|
||||
for name, func in api_impl.ROUTES:
|
||||
app.add_route('/' + name, EndpointWrapper(func, api))
|
||||
endpoint = EndpointWrapper(func, api)
|
||||
app.add_route(f"/{name}", endpoint)
|
||||
if legacy_urls:
|
||||
app.add_route(f"/{name}.php", endpoint)
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user