Skip to content

Commit

Permalink
feat: inbox and outbox routes, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed May 28, 2023
1 parent e355d5b commit 4d126aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/controllers/activitypub.js
Expand Up @@ -39,3 +39,17 @@ Controller.getActor = async (req, res) => {
},
});
};

Controller.getOutbox = async (req, res) => {
// stub
res.status(200).json({
'@context': 'https://www.w3.org/ns/activitystreams',
type: 'OrderedCollection',
totalItems: 0,
orderedItems: [],
});
};

Controller.postInbox = async (req, res) => {
res.sendStatus(405);
};
6 changes: 6 additions & 0 deletions src/routes/activitypub.js
Expand Up @@ -4,4 +4,10 @@ module.exports = function (app, middleware, controllers) {
const middlewares = [middleware.proceedOnActivityPub, middleware.exposeUid];

app.get('/user/:userslug', middlewares, controllers.activitypub.getActor);

app.get('/user/:userslug/outbox', middlewares, controllers.activitypub.getOutbox);
// app.post('/user/:userslug/outbox'...)

// app.get('/user/:userslug/inbox'...)
app.post('/user/:userslug/inbox', middlewares, controllers.activitypub.postInbox);
};

0 comments on commit 4d126aa

Please sign in to comment.