// [Joshen] Allowlist of API endpoints supported in hosted (platform) mode. // Every other /api/* route must 404 in platform mode (enforced by the request // middleware in start.ts). export const HOSTED_SUPPORTED_API_URLS = [ '/ai/sql/generate-v4', '/ai/feedback/rate', '/ai/code/complete', '/ai/sql/cron-v2', '/ai/sql/title-v2', '/ai/sql/filter-v1', '/ai/feedback/classify', '/ai/docs', '/get-ip-address', '/get-utc-time', '/get-deployment-commit', '/check-cname', '/edge-functions/test', '/edge-functions/body', '/generate-attachment-url', '/status-page', '/api/integrations/stripe-sync', '/content/graphql', '/scoped-access-token-permissions', ] // `pathname` must be basePath-relative (the request middleware in start.ts // strips BASE_PATH before calling). Entries are path suffixes, so `endsWith` // stays correct regardless. export function isHostedSupportedApiPath(pathname: string): boolean { return HOSTED_SUPPORTED_API_URLS.some((url) => pathname.endsWith(url)) }