mattp
mattp
Explore posts from servers
CDCloudflare Developers
Created by mattp on 9/16/2024 in #workers-help
How to cache worker response?
i see, thank you!
8 replies
CDCloudflare Developers
Created by mattp on 9/16/2024 in #workers-help
How to cache worker response?
is there a default cache setting for my worker if i set a custom domain (my cf domain) to my worker?
8 replies
CDCloudflare Developers
Created by mattp on 9/16/2024 in #workers-help
How to cache worker response?
@Chaika So, the worker will always be invocated even if I have set up a cache rule for the worker route, right?
8 replies
CDCloudflare Developers
Created by mattp on 7/1/2024 in #workers-help
Is worker binding call included in Cloudflare REST API rate limits?
no to the first question, yes to the second.
4 replies
CDCloudflare Developers
Created by mattp on 7/1/2024 in #kv
https://developers.cloudflare.com/
what about wrangler kv commands?
2 replies
HHono
Created by mattp on 6/13/2024 in #help
@hono/zod-openapi: How to write OpenAPI doc for middleware responses?
oh i figured it out. must explicitly given the response status to prevent type error.
app.openapi(
createRoute({
middleware: [auth],
method: 'get',
path: '/my-endpoint',
security: [{ Authorization: [] }],
request: {
// ...
},
responses: {
200: {
// ...
},
401: {
// ...
}
},
}),
async (ctx) => {
// do something
return ctx.json({ ok: true }, 200) // <- explict
}
)
app.openapi(
createRoute({
middleware: [auth],
method: 'get',
path: '/my-endpoint',
security: [{ Authorization: [] }],
request: {
// ...
},
responses: {
200: {
// ...
},
401: {
// ...
}
},
}),
async (ctx) => {
// do something
return ctx.json({ ok: true }, 200) // <- explict
}
)
2 replies
CDCloudflare Developers
Created by mattp on 2/2/2024 in #workers-help
How to seed local KV (.wrangler/state)?
Thank you
3 replies
CDCloudflare Developers
Created by mattp on 10/17/2023 in #workers-help
Download KV record in bulk
My workaround: Add a fetch handler which will list all kv records and return as a application/json response. @James Is there a way to have fetch handler only on local development? Something like:
export default {
...(ENV === 'development' && {
fetch: myHandler,
})
}
export default {
...(ENV === 'development' && {
fetch: myHandler,
})
}
I want to have a helper function which can interact with KV/R2 only on local development, so I don't have to comment out the fetch handler before I deploy to prod.
3 replies
CDCloudflare Developers
Created by mattp on 9/21/2023 in #workers-help
Can I have route trigger only on local development?
@kian Any idea? 🥺
5 replies
CDCloudflare Developers
Created by mattp on 9/21/2023 in #workers-help
Can I have route trigger only on local development?
But not mess around with my scheduled job
5 replies
CDCloudflare Developers
Created by mattp on 9/21/2023 in #workers-help
Can I have route trigger only on local development?
Just want to run some scripts that can interact with KV, R2, ...
5 replies
CDCloudflare Developers
Created by mattp on 7/31/2023 in #pages-help
How to add KV binding to Qwik City project in local development?
3 replies
CDCloudflare Developers
Created by mattp on 7/31/2023 in #pages-help
How to add KV binding to Qwik City project in local development?
3 replies
CDCloudflare Developers
Created by mattp on 8/1/2023 in #pages-discussions
https developers cloudflare com pages
The sveltekit docs are so well-written omg
4 replies
CDCloudflare Developers
Created by mattp on 8/1/2023 in #pages-discussions
https developers cloudflare com pages
And it requires an additional setup if you want to use KV binding for local development
4 replies
CDCloudflare Developers
Created by mattp on 8/1/2023 in #pages-discussions
https developers cloudflare com pages
Took me hours to figure it out omg
4 replies