-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: adding health check view and doc endpoint (#391)
* feature: adding health check view and doc endpoint
- Loading branch information
1 parent
4d404fa
commit 714dae3
Showing
3 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from drf_yasg import openapi | ||
from drf_yasg.views import get_schema_view | ||
from rest_framework import permissions | ||
|
||
schema_view = get_schema_view( | ||
openapi.Info( | ||
title="Weni Chats API", | ||
default_version="v1", | ||
description="-", | ||
terms_of_service="https://weni.ai/termos-de-uso/", | ||
contact=openapi.Contact(email="[email protected]"), | ||
license=openapi.License(name="GPL-3.0"), | ||
), | ||
public=True, | ||
permission_classes=[permissions.AllowAny], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
1. Import the include() function: from django.urls import include, path | ||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
|
||
import re | ||
|
||
from django.conf import settings | ||
|
@@ -21,26 +22,12 @@ | |
from django.contrib import admin | ||
from django.urls import path, re_path | ||
from django.views.static import serve | ||
from drf_yasg import openapi | ||
from drf_yasg.views import get_schema_view | ||
from rest_framework import permissions | ||
|
||
schema_view = get_schema_view( | ||
openapi.Info( | ||
title="Weni Chats API", | ||
default_version="v1", | ||
description="-", | ||
terms_of_service="https://weni.ai/termos-de-uso/", | ||
contact=openapi.Contact(email="[email protected]"), | ||
license=openapi.License(name="GPL-3.0"), | ||
), | ||
public=True, | ||
permission_classes=[permissions.AllowAny], | ||
) | ||
|
||
from chats.apps.api.v1.swagger import schema_view | ||
from django.http import HttpResponse | ||
|
||
urlpatterns = [ | ||
path("", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"), | ||
path("", lambda _: HttpResponse()), | ||
path("doc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"), | ||
path("admin/", admin.site.urls), | ||
path("v1/", include("chats.apps.api.v1.urls")), | ||
] | ||
|