diff options
author | Alan Pearce | 2017-07-20 18:08:12 +0200 |
---|---|---|
committer | Alan Pearce | 2017-07-20 18:08:12 +0200 |
commit | 7bf25f232569aa62edf1c88e7014a9f3c1b37014 (patch) | |
tree | 7d7d40cfa295c405427cb3bc859757b1effb0e71 /src/app.js | |
parent | a62fb1e7584ffa53a256ff8ce4d6a451ca542f20 (diff) | |
download | homestead-7bf25f232569aa62edf1c88e7014a9f3c1b37014.tar.lz homestead-7bf25f232569aa62edf1c88e7014a9f3c1b37014.tar.zst homestead-7bf25f232569aa62edf1c88e7014a9f3c1b37014.zip |
feat: Create feed handler for root
Diffstat (limited to 'src/app.js')
-rw-r--r-- | src/app.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js index 912dda2..a323b9c 100644 --- a/src/app.js +++ b/src/app.js @@ -13,6 +13,13 @@ const config = require("./modules/config.js"); const Router = require("koa-router"); const router = new Router(); +const makeTagURI = (authority, startDate) => specific => + `tag:${authority},${startDate}:${specific}`; + +app.context.makeTagURI = makeTagURI( + config.feed.originalDomainName, + config.feed.domainStartDate +); app.context.getURL = router.url.bind(router); module.exports = async function() { @@ -35,6 +42,12 @@ module.exports = async function() { ); router.get( + "feed", + "/index.xml", + actions.posts(config, responders.feed, Posts.posts) + ); + + router.get( "post", "/post/:filename", actions.post(config, responders.post, Posts.posts) |