1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 06:15:54 +02:00
Files
misskey/src/server/activitypub/publickey.ts
syuilo f5c55d46b7 wip
2018-04-05 17:52:46 +09:00

19 lines
502 B
TypeScript

import * as express from 'express';
import context from '../../remote/activitypub/renderer/context';
import render from '../../remote/activitypub/renderer/key';
import config from '../../config';
import withUser from './with-user';
const app = express.Router();
app.get('/@:user/publickey', withUser(username => {
return `${config.url}/@${username}/publickey`;
}, (user, req, res) => {
const rendered = render(user);
rendered['@context'] = context;
res.json(rendered);
}));
export default app;