about summary refs log tree commit diff
path: root/bskylink/src/routes/index.ts
blob: f60b99bcb7ad17d66d6f03f7d1374cb68d2e7734 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}