Implement apps API (the stupid way)

This commit is contained in:
Alex Gleason 2023-03-04 20:59:39 -06:00
parent 484a396a64
commit 8ed662321d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 25 additions and 0 deletions

21
src/api/apps.ts Normal file
View File

@ -0,0 +1,21 @@
import type { Context } from '@/deps.ts';
const FAKE_APP = {
id: '1',
name: 'Nostrverse',
website: null,
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
client_id: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
client_secret: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
vapid_key: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
};
function createAppController(c: Context) {
return c.json(FAKE_APP);
}
function appVerifyCredentials(c: Context) {
return c.json(FAKE_APP);
}
export { appVerifyCredentials, createAppController };

View File

@ -1,4 +1,5 @@
import { Hono } from '@/deps.ts';
import { appVerifyCredentials, createAppController } from './api/apps.ts';
import instanceController from './api/instance.ts';
@ -6,4 +7,7 @@ const app = new Hono();
app.get('/api/v1/instance', instanceController);
app.get('/api/v1/apps/verify_credentials', appVerifyCredentials);
app.post('/api/v1/apps', createAppController);
export default app;