Add additional fallback controllers

This commit is contained in:
Alex Gleason 2023-03-05 00:36:37 -06:00
parent cde34bffd8
commit 2ab9e60048
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import type { Context } from '@/deps.ts'; import type { Context } from '@/deps.ts';
const emptyArrayController = (c: Context) => c.json([]); const emptyArrayController = (c: Context) => c.json([]);
const emptyObjectController = (c: Context) => c.json({});
export { emptyArrayController }; export { emptyArrayController, emptyObjectController };

View File

@ -2,7 +2,7 @@ import { cors, Hono } from '@/deps.ts';
import { credentialsController } from './api/accounts.ts'; import { credentialsController } from './api/accounts.ts';
import { appCredentialsController, createAppController } from './api/apps.ts'; import { appCredentialsController, createAppController } from './api/apps.ts';
import { emptyArrayController } from './api/fallback.ts'; import { emptyArrayController, emptyObjectController } from './api/fallback.ts';
import instanceController from './api/instance.ts'; import instanceController from './api/instance.ts';
import { createTokenController } from './api/oauth.ts'; import { createTokenController } from './api/oauth.ts';
import { createStatusController } from './api/statuses.ts'; import { createStatusController } from './api/statuses.ts';
@ -17,6 +17,7 @@ app.get('/api/v1/apps/verify_credentials', appCredentialsController);
app.post('/api/v1/apps', createAppController); app.post('/api/v1/apps', createAppController);
app.post('/oauth/token', createTokenController); app.post('/oauth/token', createTokenController);
app.post('/oauth/revoke', emptyObjectController);
app.get('/api/v1/accounts/verify_credentials', credentialsController); app.get('/api/v1/accounts/verify_credentials', credentialsController);
@ -24,7 +25,15 @@ app.post('/api/v1/statuses', createStatusController);
// Not (yet) implemented. // Not (yet) implemented.
app.get('/api/v1/timelines/*', emptyArrayController); app.get('/api/v1/timelines/*', emptyArrayController);
app.get('/api/v1/notifications', emptyArrayController);
app.get('/api/v1/accounts/:id/statuses', emptyArrayController); app.get('/api/v1/accounts/:id/statuses', emptyArrayController);
app.get('/api/v1/bookmarks', emptyArrayController); app.get('/api/v1/bookmarks', emptyArrayController);
app.get('/api/v1/custom_emojis', emptyArrayController);
app.get('/api/v1/accounts/search', emptyArrayController);
app.get('/api/v2/search', (c) => c.json({ accounts: [], statuses: [], hashtags: [] }));
app.get('/api/v1/filters', emptyArrayController);
app.get('/api/v1/blocks', emptyArrayController);
app.get('/api/v1/mutes', emptyArrayController);
app.get('/api/v1/domain_blocks', emptyArrayController);
export default app; export default app;