mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
[moderation] stub voice endpoint
This commit is contained in:
@@ -23,4 +23,16 @@ const app = new Hono<App>()
|
||||
return c.text('hello, world!')
|
||||
})
|
||||
|
||||
// Voice-moderation vendor credentials. The client fetches these while setting up voice
|
||||
// so it can talk to the moderation vendor DIRECTLY — the audio never passes through this
|
||||
// service, which is why the credentials are handed out rather than used server-side.
|
||||
//
|
||||
// Both are deliberately EMPTY: no vendor account is wired up here, and the client treats
|
||||
// blank credentials as "voice moderation is off" instead of failing voice setup. The keys
|
||||
// must still be present and strings — a missing key or a null trips the client's parser.
|
||||
// Note `AccountId` is a STRING even though it reads as a number.
|
||||
.get('/voice/config', (c) => {
|
||||
return c.json({ AccountId: '', ApiKey: '' })
|
||||
})
|
||||
|
||||
export default app
|
||||
|
||||
@@ -6,3 +6,9 @@ it('response with hello world', async () => {
|
||||
expect(res.status).toBe(200)
|
||||
expect(await res.text()).toMatchInlineSnapshot(`"hello, world!"`)
|
||||
})
|
||||
|
||||
it('serves empty voice moderation credentials', async () => {
|
||||
const res = await SELF.fetch('https://example.com/voice/config')
|
||||
expect(res.status).toBe(200)
|
||||
expect(await res.json()).toEqual({ AccountId: '', ApiKey: '' })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user