bateswebtech
bateswebtech
CDCloudflare Developers
Created by bateswebtech on 10/7/2024 in #pages-help
Getting a 500 internal server error
We don't have anything installed, it's a static site with sveltekit. Reverting to a previous successfull deployment from the 4th from the dashboard site works fine so nothing has changed there. Wasn't sure if this is a CF error.
8 replies
CDCloudflare Developers
Created by bateswebtech on 10/7/2024 in #pages-help
Getting a 500 internal server error
@Walshy | Deploying Just checked the log and getting "logs": [ { "message": [ "Error: Publishable key not valid." ], "level": "error", "timestamp": 1728300534025 } ], This is from a github linked deployment
8 replies
CDCloudflare Developers
Created by Peter Belbin on 8/14/2023 in #workers-help
How does one define a Wrangler project to be independent of the containing monorepo?
If you are using pnpm you can exclude projects pretty easily. pnpm-workspace.yaml
packages:
# all packages in direct subdirs of packages/
- 'packages/*'
# all packages in subdirs of components/
- 'components/**'
# exclude packages that are inside test directories
- '!**/test/**'
packages:
# all packages in direct subdirs of packages/
- 'packages/*'
# all packages in subdirs of components/
- 'components/**'
# exclude packages that are inside test directories
- '!**/test/**'
2 replies
CDCloudflare Developers
Created by bateswebtech on 8/16/2023 in #workers-help
[ERROR] Could not resolve "node:buffer"
@HardAtWork That did the trick, much appreciated!
4 replies
CDCloudflare Developers
Created by bateswebtech on 6/10/2023 in #workers-help
Deployment error when using [placement] mode="smart"
hmm. this is just a simple hono router worker
11 replies
CDCloudflare Developers
Created by bateswebtech on 6/10/2023 in #workers-help
Deployment error when using [placement] mode="smart"
11 replies
CDCloudflare Developers
Created by bateswebtech on 4/10/2023 in #workers-help
Trying to make a simple cache using a cloudflare worker with hono.
@kiannh Thank you. I got it working like this.
app.get('/events', async (c) => {
try {
const cacheUrl = c.req.url
const cache = caches.default

// Check if our response is already in the cache
let response = await cache.match(cacheUrl)

if (!response) {
const { email } = c.req.query()
const config = getConfig(c.env)
const events = await findEvents(email, config)

response = new Response(JSON.stringify({ data: events }))
response.headers.append('Cache-Control', 's-maxage=10')

c.executionCtx.waitUntil(cache.put(cacheUrl, response.clone()))

return c.json({
data: events
})
} else {
const { data } = (await response.json()) as EventResponse
return c.json({ data })
}
} catch (err: Error | any) {
return c.json(
{
error: {
message: err.message
}
},
500
)
}
})
app.get('/events', async (c) => {
try {
const cacheUrl = c.req.url
const cache = caches.default

// Check if our response is already in the cache
let response = await cache.match(cacheUrl)

if (!response) {
const { email } = c.req.query()
const config = getConfig(c.env)
const events = await findEvents(email, config)

response = new Response(JSON.stringify({ data: events }))
response.headers.append('Cache-Control', 's-maxage=10')

c.executionCtx.waitUntil(cache.put(cacheUrl, response.clone()))

return c.json({
data: events
})
} else {
const { data } = (await response.json()) as EventResponse
return c.json({ data })
}
} catch (err: Error | any) {
return c.json(
{
error: {
message: err.message
}
},
500
)
}
})
I wasn't able to directly return the response and I've also tried with response.clone(). Is there something I'm missing here?
5 replies
CDCloudflare Developers
Created by omar4289 on 3/16/2023 in #r2
content length / content type header enforcement on pre-signed urls
I was hoping to get it working with the package they showed in the official docs https://developers.cloudflare.com/r2/data-access/s3-api/presigned-urls ever tried that one?
5 replies
CDCloudflare Developers
Created by omar4289 on 3/16/2023 in #r2
content length / content type header enforcement on pre-signed urls
I will try to look into this more as well, any additional details would be much appreciated.
5 replies