Main index
add_optional_versioned_base_urls(app)
¶
Add the following OPTIONAL prefixes/base URLs to server:
/vMajor.Minor
/vMajor.Minor.Patch
Source code in optimade/server/main_index.py
def add_optional_versioned_base_urls(app: FastAPI):
"""Add the following OPTIONAL prefixes/base URLs to server:
```
/vMajor.Minor
/vMajor.Minor.Patch
```
"""
for version in ("minor", "patch"):
app.include_router(index_info.router, prefix=BASE_URL_PREFIXES[version])
app.include_router(links.router, prefix=BASE_URL_PREFIXES[version])