Redirect from server to the client if no server url responds to the request
This commit is contained in:
parent
9d47f0349a
commit
bac0690721
|
|
@ -31,5 +31,4 @@
|
|||
title: 'Modules with Apollo'
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class PrivateGraphQLView(LoginRequiredMixin, GraphQLView):
|
|||
def home(request):
|
||||
if settings.DEBUG:
|
||||
try:
|
||||
return HttpResponse(requests.get('http://localhost:8080/{}'.format(request.get_full_path())).text)
|
||||
return HttpResponse(requests.get('http://localhost:3000/{}'.format(request.get_full_path())).text)
|
||||
except Exception as e:
|
||||
print('Can not connect to dev server at http://localhost:8080:', e)
|
||||
print('Can not connect to dev server at http://localhost:3000:', e)
|
||||
|
||||
return render(request, 'index.html', {})
|
||||
|
|
|
|||
Loading…
Reference in New Issue