34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { i18n } from './i18n'
|
|
import { sdk } from './sdk'
|
|
import { uiPort } from './utils'
|
|
|
|
// Single HTTP interface on port 3002. Operators wire a public hostname
|
|
// (e.g. relay.yourdomain.com) to this interface via StartTunnel; Recap
|
|
// installs point their "Set Relay URL" action at that hostname. The
|
|
// /admin/* paths require admin auth (set via "Set Admin Password"
|
|
// action); the /relay/* paths are authenticated per-call via
|
|
// X-Recap-Install-Id + optional Authorization: Bearer LIC1-... headers.
|
|
export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => {
|
|
const apiMulti = sdk.MultiHost.of(effects, 'api-multi')
|
|
const apiOrigin = await apiMulti.bindPort(uiPort, {
|
|
protocol: 'http',
|
|
})
|
|
const api = sdk.createInterface(effects, {
|
|
name: i18n('Relay Endpoint'),
|
|
id: 'api',
|
|
description: i18n(
|
|
'HTTP endpoint for Recap clients to relay transcribe + analyze calls. Also serves the operator admin dashboard at /admin/.',
|
|
),
|
|
type: 'ui',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const apiReceipt = await apiOrigin.export([api])
|
|
|
|
return [apiReceipt]
|
|
})
|