Skip to content
Snippets Groups Projects
Commit 1131ce8a authored by syuilo's avatar syuilo
Browse files

sharedInboxを提供

parent 02bb99ac
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ export default user => {
id,
inbox: `${id}/inbox`,
outbox: `${id}/outbox`,
sharedInbox: `${config.url}/inbox`,
url: `${config.url}/@${user.username}`,
preferredUsername: user.username,
name: user.name,
......
import * as mongo from 'mongodb';
import * as Koa from 'koa';
import * as Router from 'koa-router';
const json = require('koa-json-body');
const httpSignature = require('http-signature');
......@@ -19,8 +20,7 @@ const router = new Router();
//#region Routing
// inbox
router.post('/users/:user/inbox', json(), ctx => {
function inbox(ctx: Koa.Context) {
let signature;
ctx.req.headers.authorization = 'Signature ' + ctx.req.headers.signature;
......@@ -39,7 +39,11 @@ router.post('/users/:user/inbox', json(), ctx => {
}).save();
ctx.status = 202;
});
}
// inbox
router.post('/inbox', json(), inbox);
router.post('/users/:user/inbox', json(), inbox);
// note
router.get('/notes/:note', async (ctx, next) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment