diff --git a/bskylink/src/routes/index.ts b/bskylink/src/routes/index.ts index cfdaf3eaa9..d03f9208b8 100644 --- a/bskylink/src/routes/index.ts +++ b/bskylink/src/routes/index.ts @@ -4,6 +4,7 @@ import {AppContext} from '../context.js' import {default as createShortLink} from './createShortLink.js' import {default as health} from './health.js' import {default as redirect} from './redirect.js' +import {default as root} from './root.js' import {default as shortLink} from './shortLink.js' import {default as siteAssociation} from './siteAssociation.js' @@ -14,6 +15,7 @@ export default function (ctx: AppContext, app: Express) { app = siteAssociation(ctx, app) // GET /.well-known/apple-app-site-association app = redirect(ctx, app) // GET /redirect app = createShortLink(ctx, app) // POST /link + app = root(ctx, app) app = shortLink(ctx, app) // GET /:linkId (should go last due to permissive matching) return app } diff --git a/bskylink/src/routes/root.ts b/bskylink/src/routes/root.ts new file mode 100644 index 0000000000..581c4e36b8 --- /dev/null +++ b/bskylink/src/routes/root.ts @@ -0,0 +1,13 @@ +import {Express} from 'express' + +import {AppContext} from '../context.js' +import {handler} from './util.js' + +export default function (_ctx: AppContext, app: Express) { + return app.get( + '/', + handler(async (_req, res) => { + return res.status(301).location('https://bsky.app') + }), + ) +}