Skip to content

Commit

Permalink
include new routes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaelicke committed Jan 16, 2025
1 parent f20401f commit 4971521
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions metacatalog_api/default_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
from metacatalog_api.apps.explorer import static_files
from metacatalog_api.router.api.read import read_router as api_read_router
from metacatalog_api.router.api.create import create_router as api_create_router
from metacatalog_api.router.api.upload import upload_router
from metacatalog_api.apps.explorer.create import create_router as explorer_create
from metacatalog_api.apps.explorer.read import explorer_router
from metacatalog_api.apps.explorer.upload import upload_router as explorer_upload

# at first we add the cors middleware to allow everyone to reach the API
app.add_middleware(
Expand All @@ -36,11 +38,13 @@ def index(request: Request):
# add all api routes - currently this is only splitted into read and create
app.include_router(api_read_router)
app.include_router(api_create_router)
app.include_router(upload_router)

# add the default explorer application (the HTML)
app.mount(f"{server.app_prefix}static", static_files, name="static")
app.include_router(explorer_router, prefix=f"/{server.app_name}")
app.include_router(explorer_create, prefix=f"/{server.app_name}")
app.include_router(explorer_upload, prefix=f"/{server.app_name}")


if __name__ == '__main__':
Expand Down

0 comments on commit 4971521

Please sign in to comment.