How do I disable the prompt each time there is a error?
How do I disable the prompt each time there is a error?
Date.now() or similarawait ai.run('@cf/openai/whisper', input);input need to be?
formdata_parser_supports_fileswrangler.toml file has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.Access-Control-Allow-Origin header?* if you don't care about CORS, and your app doesn't need anything else*router.post("/add", async (res, req) => { return CustomResponse(myJSONPayload, 200) })itty-router ?[sites] attribute in wrangler.toml then yes, they're charged since that uploads them to Workers KV but there's no size limit that way except for the KV per-value limit.hono was amazing than itty for the routing and cors issueawait ai.run('@cf/openai/whisper', input);formdata_parser_supports_files has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.Access-Control-Allow-Originconst corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Max-Age': '86400', // optional
'Access-Control-Allow-Headers': 'Content-Type',
};
const CustomResponse = (body: any, status: number = 200) => {
return new Response(body, {
headers: {
...corsHeaders,
'Content-Type': 'application/json',
},
status,
});
};router.post("/add", async (res, req) => { return CustomResponse(myJSONPayload, 200) })import { Router, createCors, error, json } from 'itty-router'
const { preflight, corsify } = createCors()
const router = Router()
router
// embed preflight upstream to handle all OPTIONS requests
.all('*', preflight)export const router = Router();
const { preflight, corsify } = createCors({
methods: ['GET', 'POST'],
origins: [
// Your origins that are okay here
]
});
router
.all('*', preflight)
.all('*', defaultRoutes.handle)
.all('*', () => error(404));['*'] or just '*'[wrangler:err] Error: No fetch handler responded and no upstream to proxy to specified.[sites]ittyawait fetch("https://some.url/", {
method: "POST",
body: formData.get("audio").stream()
});await ai.run('@cf/openai/whisper', {
audio: [...new Uint8Array(await formData.get("audio").arrayBuffer())],
});