summaryrefslogtreecommitdiff
path: root/routes.js
diff options
context:
space:
mode:
authorDarius Kazemi <darius.kazemi@gmail.com>2020-01-06 23:29:24 -0800
committerDarius Kazemi <darius.kazemi@gmail.com>2020-01-06 23:29:24 -0800
commit5ffe6115740cfa293322e1961e7c9996e32ce2a4 (patch)
treebaae6484940c790bf560b32ee0cd4daa997502a5 /routes.js
parentf5178f1a663c721c910b793a2dfd5b2cc6ce9e76 (diff)
move function to activitypub file
Diffstat (limited to 'routes.js')
-rwxr-xr-xroutes.js20
1 files changed, 1 insertions, 19 deletions
diff --git a/routes.js b/routes.js
index e90360c..b988fee 100755
--- a/routes.js
+++ b/routes.js
@@ -132,24 +132,6 @@ const deleteOldEvents = schedule.scheduleJob('59 23 * * *', function(fireDate){
});
});
-
-// ACTIVITYPUB HELPER FUNCTIONS
-function createWebfinger(eventID, domain) {
- return {
- 'subject': `acct:${eventID}@${domain}`,
-
- 'links': [
- {
- 'rel': 'self',
- 'type': 'application/activity+json',
- 'href': `https://${domain}/${eventID}`
- }
- ]
- };
-}
-
-
-
// FRONTEND ROUTES
router.get('/', (req, res) => {
@@ -278,7 +260,7 @@ router.get('/.well-known/webfinger', (req, res) => {
res.render('404', { url: req.url });
}
else {
- res.json(createWebfinger(eventID, domain));
+ res.json(ap.createWebfinger(eventID, domain));
}
})
.catch((err) => {