Add landing page

This commit is contained in:
Alex Gleason 2023-04-30 14:51:56 -05:00
parent 610ce4444a
commit cb8e78ab59
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 18 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import instanceController from './controllers/api/instance.ts';
import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts'; import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts';
import { contextController, createStatusController, statusController } from './controllers/api/statuses.ts'; import { contextController, createStatusController, statusController } from './controllers/api/statuses.ts';
import { requireAuth, setAuth } from './middleware/auth.ts'; import { requireAuth, setAuth } from './middleware/auth.ts';
import { indexController } from './controllers/site.ts';
interface AppEnv extends HonoEnv { interface AppEnv extends HonoEnv {
Variables: { Variables: {
@ -65,6 +66,8 @@ app.get('/api/v1/mutes', emptyArrayController);
app.get('/api/v1/domain_blocks', emptyArrayController); app.get('/api/v1/domain_blocks', emptyArrayController);
app.get('/api/v1/markers', emptyObjectController); app.get('/api/v1/markers', emptyObjectController);
app.get('/', indexController);
export default app; export default app;
export type { AppContext, AppController, AppMiddleware }; export type { AppContext, AppController, AppMiddleware };

15
src/controllers/site.ts Normal file
View File

@ -0,0 +1,15 @@
import { LOCAL_DOMAIN } from '@/config.ts';
import type { AppController } from '@/app.ts';
/** Landing page controller. */
const indexController: AppController = (c) => {
return c.text(`Please connect with a Mastodon client:
${LOCAL_DOMAIN}
Ditto <https://gitlab.com/soapbox-pub/ditto>
`);
};
export { indexController };