mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-02 16:37:36 +01:00
wip
This commit is contained in:
parent
fc15249aa4
commit
d3ed2761b9
1 changed files with 12 additions and 9 deletions
|
@ -1,11 +1,12 @@
|
|||
import * as express from 'express';
|
||||
|
||||
import config from '../config';
|
||||
import parseAcct from '../acct/parse';
|
||||
import User from '../models/user';
|
||||
const express = require('express');
|
||||
|
||||
const app = express();
|
||||
|
||||
app.get('/.well-known/webfinger', async (req, res) => {
|
||||
app.get('/.well-known/webfinger', async (req: express.Request, res: express.Response) => {
|
||||
if (typeof req.query.resource !== 'string') {
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
|
@ -34,13 +35,15 @@ app.get('/.well-known/webfinger', async (req, res) => {
|
|||
|
||||
return res.json({
|
||||
subject: `acct:${user.username}@${config.host}`,
|
||||
links: [
|
||||
{
|
||||
rel: 'self',
|
||||
type: 'application/activity+json',
|
||||
href: `${config.url}/@${user.username}`
|
||||
}
|
||||
]
|
||||
links: [{
|
||||
rel: 'self',
|
||||
type: 'application/activity+json',
|
||||
href: `${config.url}/@${user.username}`
|
||||
}, {
|
||||
rel: 'http://webfinger.net/rel/profile-page',
|
||||
type: 'text/html',
|
||||
href: `${config.url}/@${user.username}`
|
||||
}]
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue