Verified Commit a1a8ef30 authored by David Haynes's avatar David Haynes 🙆
Browse files

refactor: Add a redirect for / -> /api

- This got really annoying in development to remember to go to /api all the time
- Potentially in the future we will build a test landing page on / to test that
the API works instead of having to rely on third party tools or just manual clicks
	- Until then, this will make life easier (imo)
parent 5bcf2aa2
Pipeline #1354 passed with stage
in 1 minute and 14 seconds
......@@ -4,6 +4,7 @@ from __future__ import (absolute_import, division, print_function,
# Django Imports
from django.conf.urls import include, url
from django.views.generic.base import RedirectView
# App Imports
from .views import CategoryViewSet, FacilityViewSet, ScheduleViewSet
......@@ -20,6 +21,9 @@ ROUTER.register(r'facilities', FacilityViewSet)
ROUTER.register(r'schedules', ScheduleViewSet)
urlpatterns = [
# / - Default route
# We redirect to /api since this is in reality the default page for the API
url(r'^$', RedirectView.as_view(url='/api')),
# /api - Root API URL
url(r'^api/', include(ROUTER.urls)),
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment