diff --git a/src/app.ts b/src/app.ts index 537f563..01381ac 100644 --- a/src/app.ts +++ b/src/app.ts @@ -14,6 +14,7 @@ import instanceController from './controllers/api/instance.ts'; import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts'; import { contextController, createStatusController, statusController } from './controllers/api/statuses.ts'; import { requireAuth, setAuth } from './middleware/auth.ts'; +import { indexController } from './controllers/site.ts'; interface AppEnv extends HonoEnv { Variables: { @@ -65,6 +66,8 @@ app.get('/api/v1/mutes', emptyArrayController); app.get('/api/v1/domain_blocks', emptyArrayController); app.get('/api/v1/markers', emptyObjectController); +app.get('/', indexController); + export default app; export type { AppContext, AppController, AppMiddleware }; diff --git a/src/controllers/site.ts b/src/controllers/site.ts new file mode 100644 index 0000000..8c0f4a9 --- /dev/null +++ b/src/controllers/site.ts @@ -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 +`); +}; + +export { indexController };