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

wip

parent fc15249a
No related branches found
No related tags found
No related merge requests found
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}`
}]
});
});
......
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