diff options
Diffstat (limited to 'pysite/views')
| -rw-r--r-- | pysite/views/__init__.py | 3 | ||||
| -rw-r--r-- | pysite/views/error_handlers/__init__.py | 3 | ||||
| -rw-r--r-- | pysite/views/error_handlers/http_404.py | 14 | ||||
| -rw-r--r-- | pysite/views/healthcheck.py | 15 | ||||
| -rw-r--r-- | pysite/views/index.py | 12 | ||||
| -rw-r--r-- | pysite/views/invite.py | 15 | 
6 files changed, 62 insertions, 0 deletions
| diff --git a/pysite/views/__init__.py b/pysite/views/__init__.py new file mode 100644 index 00000000..ba286add --- /dev/null +++ b/pysite/views/__init__.py @@ -0,0 +1,3 @@ +# coding=utf-8 + +__author__ = "Gareth Coles" diff --git a/pysite/views/error_handlers/__init__.py b/pysite/views/error_handlers/__init__.py new file mode 100644 index 00000000..ba286add --- /dev/null +++ b/pysite/views/error_handlers/__init__.py @@ -0,0 +1,3 @@ +# coding=utf-8 + +__author__ = "Gareth Coles" diff --git a/pysite/views/error_handlers/http_404.py b/pysite/views/error_handlers/http_404.py new file mode 100644 index 00000000..eea1e630 --- /dev/null +++ b/pysite/views/error_handlers/http_404.py @@ -0,0 +1,14 @@ +# coding=utf-8 +from werkzeug.exceptions import NotFound + +from pysite.base_route import ErrorView + +__author__ = "Gareth Coles" + + +class Error404View(ErrorView): +    name = "error_404" +    error_code = 404 + +    def get(self, error: NotFound): +        return "replace me with a template, 404 not found", 404 diff --git a/pysite/views/healthcheck.py b/pysite/views/healthcheck.py new file mode 100644 index 00000000..660c8a96 --- /dev/null +++ b/pysite/views/healthcheck.py @@ -0,0 +1,15 @@ +# coding=utf-8 +from flask import jsonify + +from pysite.base_route import BaseView + + +__author__ = "Gareth Coles" + + +class IndexView(BaseView): +    path = "/healthcheck" +    name = "healthcheck" + +    def get(self): +        return jsonify({"status": "ok"}) diff --git a/pysite/views/index.py b/pysite/views/index.py new file mode 100644 index 00000000..2e779003 --- /dev/null +++ b/pysite/views/index.py @@ -0,0 +1,12 @@ +# coding=utf-8 +from pysite.base_route import BaseView + +__author__ = "Gareth Coles" + + +class IndexView(BaseView): +    path = "/" +    name = "index" + +    def get(self): +        return "Coming soon:tm:" diff --git a/pysite/views/invite.py b/pysite/views/invite.py new file mode 100644 index 00000000..d035fc99 --- /dev/null +++ b/pysite/views/invite.py @@ -0,0 +1,15 @@ +# coding=utf-8 +from flask import redirect + +from pysite.base_route import BaseView + + +__author__ = "Gareth Coles" + + +class InviteView(BaseView): +    path = "/invite" +    name = "invite" + +    def get(self): +        return redirect("http://invite.pythondiscord.com/") | 
