Skip to content

Commit

Permalink
feat(api): move generic endpoint to feature route
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz committed May 11, 2023
1 parent be79bfd commit 33c649c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api/registry/api/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

analytics_router = Router()

feature_flag_router = Router()


@router.get(
"/signing-message",
Expand Down Expand Up @@ -323,7 +325,7 @@ def get_passport_stamps(
return response


@router.post(
@feature_flag_router.post(
"/communities/generic",
auth=ApiKey(),
response={
Expand Down
5 changes: 4 additions & 1 deletion api/scorer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ceramic_cache.api import router as ceramic_cache_router
from django_ratelimit.exceptions import Ratelimited
from ninja import NinjaAPI
from registry.api.v1 import analytics_router
from registry.api.v1 import analytics_router, feature_flag_router
from registry.api.v1 import router as registry_router_v1
from registry.api.v2 import router as registry_router_v2

Expand All @@ -29,6 +29,9 @@ def service_unavailable(request, _):
"/registry/", registry_router_v1, tags=["Score your passport"]
)

feature_flag_api = NinjaAPI(urls_namespace="feature")
feature_flag_api.add_router("", feature_flag_router)

registry_api_v2.add_router("", registry_router_v2, tags=["Score your passport"])

ceramic_cache_api = NinjaAPI(urls_namespace="ceramic-cache", docs_url=None)
Expand Down
9 changes: 8 additions & 1 deletion api/scorer/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
from django.contrib.auth import views as auth_views
from django.urls import include, path

from .api import analytics_api, ceramic_cache_api, registry_api_v1, registry_api_v2
from .api import (
analytics_api,
ceramic_cache_api,
feature_flag_api,
registry_api_v1,
registry_api_v2,
)

urlpatterns = [
path("", registry_api_v1.urls),
path("registry/v2/", registry_api_v2.urls),
path("registry/feature/", feature_flag_api.urls),
path("ceramic-cache/", ceramic_cache_api.urls),
path("analytics/", analytics_api.urls),
path("health/", health, {}, "health-check"),
Expand Down

0 comments on commit 33c649c

Please sign in to comment.