about summary refs log tree commit diff
path: root/bskylink/src/routes/index.ts
diff options
context:
space:
mode:
authordevin ivy <devinivy@gmail.com>2024-06-21 12:41:06 -0400
committerGitHub <noreply@github.com>2024-06-21 12:41:06 -0400
commit55812b03940852f1f91cd0a46b5c093601c854a9 (patch)
tree54956cb522786b1260b0a556f6f7c3ea1b0aed11 /bskylink/src/routes/index.ts
parentba21fddd7897513fef663b826094878ad0ff1556 (diff)
downloadvoidsky-55812b03940852f1f91cd0a46b5c093601c854a9.tar.zst
Bsky short link service (#4542)
* bskylink: scaffold service w/ initial config and schema

* bskylink: implement link creation and redirects

* bskylink: tidy

* bskylink: tests

* bskylink: tidy, add error handler

* bskylink: add dockerfile

* bskylink: add build

* bskylink: fix some express plumbing

* bskyweb: proxy fallthrough routes to link service redirects

* bskyweb: build w/ link proxy

* Add AASA to bskylink (#4588)

---------

Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'bskylink/src/routes/index.ts')
-rw-r--r--bskylink/src/routes/index.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/bskylink/src/routes/index.ts b/bskylink/src/routes/index.ts
new file mode 100644
index 000000000..f60b99bcb
--- /dev/null
+++ b/bskylink/src/routes/index.ts
@@ -0,0 +1,17 @@
+import {Express} from 'express'
+
+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
+}