From a6ea6c0aca83433130981b1fa103acd8dbbd6c83 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 20 Jun 2024 15:58:38 -0700 Subject: [PATCH] Add AASA to bskylink (#4588) --- bskylink/src/routes/index.ts | 2 ++ bskylink/src/routes/siteAssociation.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 bskylink/src/routes/siteAssociation.ts diff --git a/bskylink/src/routes/index.ts b/bskylink/src/routes/index.ts index a54333c0b7..f60b99bcb7 100644 --- a/bskylink/src/routes/index.ts +++ b/bskylink/src/routes/index.ts @@ -4,11 +4,13 @@ import {AppContext} from '../context.js' import {default as create} from './create.js' import {default as health} from './health.js' import {default as redirect} from './redirect.js' +import {default as siteAssociation} from './siteAssociation.js' export * from './util.js' export default function (ctx: AppContext, app: Express) { app = health(ctx, app) // GET /_health + app = siteAssociation(ctx, app) // GET /.well-known/apple-app-site-association app = create(ctx, app) // POST /link app = redirect(ctx, app) // GET /:linkId (should go last due to permissive matching) return app diff --git a/bskylink/src/routes/siteAssociation.ts b/bskylink/src/routes/siteAssociation.ts new file mode 100644 index 0000000000..ae3b42e304 --- /dev/null +++ b/bskylink/src/routes/siteAssociation.ts @@ -0,0 +1,13 @@ +import {Express} from 'express' + +import {AppContext} from '../context.js' + +export default function (ctx: AppContext, app: Express) { + return app.get('/.well-known/apple-app-site-association', (req, res) => { + res.json({ + appclips: { + apps: ['B3LX46C5HS.xyz.blueskyweb.app.AppClip'], + }, + }) + }) +}