OverviewFilesCommitsIssuesDocsReleasesPeers

atproto-bridge / index.js

15 lines · javascript ref:
// Deploy entry — the app launcher pgh/pear-git invokes as `bare index.js`.
//
// ONE closure, TWO apps. pgh sets PGH_APP_NAME to the install name, so the SAME published tree runs
// EITHER the keyless HTTP MEMBRANE (default — pds/bin/pds-serve.js, node-vs-bare + env config) OR the
// blind-peering AVAILABILITY RELAY (installed under a `*blind-relay*` name — pds/bin/blind-relay.js,
// seeds an allowlist of peers so single/offline peers stay frontable on bsky). Select by the install
// name (or ATPROTO_MODE=relay) so `pgh app install <key> --name atproto-blind-relay` just works.
import process from '#node:process'
const appName = process.env.PGH_APP_NAME || ''
if (process.env.ATPROTO_MODE === 'relay' || /blind-relay/.test(appName)) {
  await import('./pds/bin/blind-relay.js')
} else {
  await import('./pds/bin/pds-serve.js')
}