/.well-known 周りをいい感じに (#4141)

* Enhance /.well-known and their friends

* Fix bug
This commit is contained in:
Acid Chicken (硫酸鶏)
2019-02-05 17:42:55 +09:00
committed by GitHub
parent 2f4434b0d8
commit 9dd06a7621
9 changed files with 202 additions and 89 deletions

View File

@ -16,7 +16,8 @@ import * as requestStats from 'request-stats';
import * as slow from 'koa-slow';
import activityPub from './activitypub';
import webFinger from './webfinger';
import nodeinfo from './nodeinfo';
import wellKnown from './well-known';
import config from '../config';
import networkChart from '../chart/network';
import apiServer from './api';
@ -68,7 +69,8 @@ const router = new Router();
// Routing
router.use(activityPub.routes());
router.use(webFinger.routes());
router.use(nodeinfo.routes());
router.use(wellKnown.routes());
router.get('/verify-email/:code', async ctx => {
const user = await User.findOne({ emailVerifyCode: ctx.params.code });
@ -88,11 +90,6 @@ router.get('/verify-email/:code', async ctx => {
}
});
// Return 404 for other .well-known
router.all('/.well-known/*', async ctx => {
ctx.status = 404;
});
// Register router
app.use(router.routes());