summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2020-06-03 23:26:24 -0400
committerOwen Jacobson <owen@grimoire.ca>2020-06-03 23:26:24 -0400
commit21de322d6cf221867ec9600e1a31777a195c7597 (patch)
tree1aab43a7559daa252cd1412a9bc2f8e3f367fe33 /app.py
parent23687bea794a18ff594658e9006457bff7b4a752 (diff)
parentebd04ae88f28a547eabbb44e1eccfd19965be7ae (diff)
Replace Python (apistar) version with Rust (actix-web) version.
Diffstat (limited to 'app.py')
-rw-r--r--app.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/app.py b/app.py
deleted file mode 100644
index 05a41bd..0000000
--- a/app.py
+++ /dev/null
@@ -1,37 +0,0 @@
-from apistar import Include, Route, annotate, render_template
-from apistar.frameworks.wsgi import WSGIApp as App
-from apistar.handlers import docs_urls, static_urls
-from apistar.renderers import HTMLRenderer
-import random
-import yaml
-
-with open('things-to-check.yml', 'r') as things_file:
- things = yaml.safe_load(things_file)
-
-@annotate(renderers=[HTMLRenderer()])
-def random_thing(item: int = None):
- if item is None:
- item = random.randrange(len(things))
- return render_template('index.html',
- item=item,
- thing=things[item],
- )
-
-
-routes = [
- Route('/', 'GET', random_thing),
- Include('/docs', docs_urls),
- Include('/static', static_urls),
-]
-
-settings = {
- 'TEMPLATES': {
- 'ROOT_DIR': 'templates', # Include the 'templates/' directory.
- 'PACKAGE_DIRS': ['apistar'] # Include the built-in apistar templates.
- }
-}
-
-app = App(
- routes=routes,
- settings=settings,
-)