Initial /avilable API view and tests

This commit is contained in:
Neil Martinsen-Burrell 2022-10-27 13:15:22 -05:00
parent 5c105f1861
commit 01553a4d91
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
6 changed files with 58 additions and 0 deletions

15
src/api/views.py Normal file
View file

@ -0,0 +1,15 @@
"""Internal API views"""
from django.views.decorators.http import require_http_methods
from django.http import JsonResponse
@require_http_methods(["GET"])
def available(request, domain=""):
"""Is a given domain available or not.
Response is a JSON dictionary with the key "available" and value true or
false.
"""
return JsonResponse({"available": False})