This commit is contained in:
syuilo
2020-04-03 23:35:14 +09:00
parent 99fc77b678
commit eec1af1f52
11 changed files with 107 additions and 880 deletions

View File

@ -15,6 +15,7 @@ import * as MarkdownIt from 'markdown-it';
import packFeed from './feed';
import { fetchMeta } from '../../misc/fetch-meta';
import { genOpenapiSpec } from '../api/openapi/gen-spec';
import config from '../../config';
import { Users, Notes, Emojis, UserProfiles, Pages } from '../../models';
import parseAcct from '../../misc/acct/parse';
@ -96,15 +97,13 @@ router.get('/api-doc', async ctx => {
});
});
router.get('/api.json', async ctx => {
await send(ctx as any, '/assets/api.json', {
root: client
});
});
// URL preview endpoint
router.get('/url', require('./url-preview'));
router.get('/api.json', async ctx => {
ctx.body = genOpenapiSpec();
});
router.get('/docs.json', async ctx => {
const lang = ctx.query.lang;
if (!Object.keys(locales).includes(lang)) {