Add /api not implemented controller
This commit is contained in:
parent
a5bf09ed2b
commit
bacb872a18
|
@ -29,7 +29,7 @@ import {
|
|||
verifyCredentialsController,
|
||||
} from './controllers/api/accounts.ts';
|
||||
import { appCredentialsController, createAppController } from './controllers/api/apps.ts';
|
||||
import { emptyArrayController, emptyObjectController } from './controllers/api/fallback.ts';
|
||||
import { emptyArrayController, emptyObjectController, notImplementedController } from './controllers/api/fallback.ts';
|
||||
import { instanceController } from './controllers/api/instance.ts';
|
||||
import { mediaController } from './controllers/api/media.ts';
|
||||
import { notificationsController } from './controllers/api/notifications.ts';
|
||||
|
@ -157,6 +157,8 @@ app.get('/api/v1/markers', emptyObjectController);
|
|||
app.get('/api/v1/conversations', emptyArrayController);
|
||||
app.get('/api/v1/lists', emptyArrayController);
|
||||
|
||||
app.use('/api/*', notImplementedController);
|
||||
|
||||
app.get('*', serveStatic({ root: './public/' }));
|
||||
app.get('*', serveStatic({ path: './public/index.html' }));
|
||||
|
||||
|
|
|
@ -2,5 +2,6 @@ import type { Context } from '@/deps.ts';
|
|||
|
||||
const emptyArrayController = (c: Context) => c.json([]);
|
||||
const emptyObjectController = (c: Context) => c.json({});
|
||||
const notImplementedController = (c: Context) => Promise.resolve(c.json({ error: 'Not implemented' }, 404));
|
||||
|
||||
export { emptyArrayController, emptyObjectController };
|
||||
export { emptyArrayController, emptyObjectController, notImplementedController };
|
||||
|
|
Loading…
Reference in New Issue