summary refs log tree commit diff stats
path: root/src/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/app.js b/src/app.js
index b6d8beb..912dda2 100644
--- a/src/app.js
+++ b/src/app.js
@@ -6,6 +6,7 @@ const app = new Koa();
 const helmet = require("koa-helmet");
 
 const actions = require("./actions.js");
+const responders = require("./responders.js");
 
 const config = require("./modules/config.js");
 
@@ -19,9 +20,13 @@ module.exports = async function() {
     router.url("post", basename)
   );
 
-  router.get("home", "/", actions.home(config, Posts.posts));
+  router.get("home", "/", actions.home(config, responders.home, Posts.posts));
 
-  router.get("posts", "/post", actions.posts(config, Posts.posts));
+  router.get(
+    "posts",
+    "/post",
+    actions.posts(config, responders.list, Posts.posts)
+  );
 
   router.get(
     "highlight-theme",
@@ -29,13 +34,17 @@ module.exports = async function() {
     actions.highlightTheme(config)
   );
 
-  router.get("post", "/post/:filename", actions.post(config, Posts.posts));
+  router.get(
+    "post",
+    "/post/:filename",
+    actions.post(config, responders.post, Posts.posts)
+  );
 
   for (let [term, items] of Posts.taxonomies) {
     router.get(
       `taxon-${term}`,
       `/${term}/:value`,
-      actions.taxonGenerator(config, term, items)
+      actions.taxonGenerator(config, responders.list, term, items)
     );
   }