from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import page_views
from . import post_views
from . import api_views
from . import file_views
from . import bookmark_views

# Create a router and register our viewsets with it
router = DefaultRouter(trailing_slash=False)
router.register('links', api_views.LinkViewSet, basename='api-links')
router.register('pages', page_views.PageViewSet, basename='api-pages')
router.register('posts', post_views.PostViewSet, basename='api-posts')
router.register('music', api_views.MusicViewSet, basename='api-music')
router.register('files', file_views.FileUploadViewSet, basename='api-files')
router.register('bookmarks', bookmark_views.BookmarkViewSet, basename='api-bookmarks')

# The API URLs are determined automatically by the router
urlpatterns = [
    path('', include(router.urls)),
    path('images/', include('links.image_urls')),

]
