Skip to content

Commit d8e01bf

Browse files
fix: test
1 parent 917fe40 commit d8e01bf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

definitions/vite-supadata-runner/worker/userRoutes.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,20 @@ export function userRoutes(app: Hono<{ Bindings: any }>) {
4040
app.post('/api/supadata/transcript', async (c) => {
4141
let apiKey = ''
4242
let e = {} as any
43+
const cookie = getCookie(c)
4344
try {
44-
e = await c.req.json();
45-
// GET API KEY BY THIS METHOD. DO NOT GET API KEY FROM ENV.
45+
// GET API KEY BY THIS METHOD. DO NOT GET API KEY FROM ENV.
4646
apiKey = await getUserAPIKey(c);
47+
} catch(e: any) {
48+
return c.json({
49+
success: false,
50+
cookie,
51+
error: e.message
52+
}, { status: 501 });
53+
}
54+
try {
55+
e = await c.req.json();
56+
4757

4858
// Initialize the client
4959
const supadata = new Supadata({

0 commit comments

Comments
 (0)