feat: proxy /api to Convex
This commit is contained in:
parent
6b4e0f6c0f
commit
3ddbac35f3
@ -3,5 +3,5 @@
|
||||
- [x] ~~Well-known v1: `/.well-known/clawdhub.json` => `{ apiBase, authBase?, minCliVersion? }` (keep backward compat)~~
|
||||
- [x] ~~Centralize registry resolution (single `getRegistry()`), cache discovery in global config~~
|
||||
- [x] ~~Split `packages/clawdhub/src/cli.ts` into modules (<500 LOC per file)~~
|
||||
- [ ] Proxy `https://clawdhub.com/api/*` to discovered `apiBase` (single-base-URL UX)
|
||||
- [x] ~~Proxy `https://clawdhub.com/api/*` to discovered `apiBase` (single-base-URL UX)~~
|
||||
- [ ] Full gate: `bun run lint`, `bun run test`, `bun run coverage`, `bun run build`, CI green
|
||||
|
||||
@ -50,6 +50,18 @@ describe('@clawdhub/schema', () => {
|
||||
'WellKnown',
|
||||
),
|
||||
).toEqual({ apiBase: 'https://example.convex.site', minCliVersion: '0.1.0' })
|
||||
|
||||
const combined = parseArk(
|
||||
WellKnownConfigSchema,
|
||||
{
|
||||
apiBase: 'https://clawdhub.com',
|
||||
registry: 'https://clawdhub.com',
|
||||
authBase: 'https://clawdhub.com',
|
||||
},
|
||||
'WellKnown',
|
||||
) as unknown as Record<string, unknown>
|
||||
expect(combined.apiBase).toBe('https://clawdhub.com')
|
||||
expect(combined.registry).toBe('https://clawdhub.com')
|
||||
})
|
||||
|
||||
it('throws labeled errors', () => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"apiBase": "https://wry-manatee-359.convex.site",
|
||||
"apiBase": "https://clawdhub.com",
|
||||
"authBase": "https://clawdhub.com",
|
||||
"minCliVersion": "0.1.0",
|
||||
"registry": "https://wry-manatee-359.convex.site"
|
||||
"registry": "https://clawdhub.com"
|
||||
}
|
||||
|
||||
8
vercel.json
Normal file
8
vercel.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"rewrites": [
|
||||
{
|
||||
"source": "/api/:path*",
|
||||
"destination": "https://wry-manatee-359.convex.site/api/:path*"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user