divby0
Explore posts from serversCDCloudflare Developers
•Created by divby0 on 4/5/2024 in #workers-help
How does the caches.default interact with fetch by default?
1 replies
CDCloudflare Developers
•Created by divby0 on 10/9/2023 in #pages-help
Make stack trace use the provided sourcemap (single file, [[path]].js + .map)
I have configured a build that yields a
functions/[[path]].js
and a functions/[[path]].js.map
file. How do I make cloudflare actually use the sourcemap so I can read and unsterand them when an error happens?
Currently for my small project I am just hitting a webhook with the stacktrace that sends the stacktrace as a telegram to me but most of the time they are not really readable.2 replies
DTDrizzle Team
•Created by divby0 on 10/3/2023 in #help
Get Raw query string of a relational query in drizzle
I need the raw query string of a relational query to perform an explain command.
The docs only explain this process for the non-relational queries :/
7 replies
CDCloudflare Developers
•Created by divby0 on 7/3/2023 in #workers-help
Reverse Proxy for blog returns 301 on custom domain, but works correct on preview url?
I've got the domain rank-hub.com added as a custom domain for a worker and a blog lives on ghost.rank-hub.com.
The worker script creates a proxy request and returns its result so I can have rank-hub.com/blog proxied to ghost.rank-hub.com/blog.
This is very easy with workers and I appreciate it, but I am probably missing a little something as the setup works on the preview url: https://rank-hub-ghost-proxy.divby0.workers.dev/blog but not on the live one https://rank-hub.com/blog
Somehow cloudflare returns a 301 to my request when I use the apex domain (so I get redirected to blog.rank-hub.com). When I use the preview url, the content is correctly proxied. What am I missing?
Worker script:
16 replies
CDCloudflare Developers
•Created by divby0 on 6/12/2023 in #workers-help
HTMLRewriter treats self closing tags like <img/> as text
I am using HTMLRewriter to get the plain text of a website. Using the following code listening to the
text
event, it results in uggly <img ....../> or <iframe .../> being included in my result:
After transforming an html response, this is how response can look like:
1 replies
DTDrizzle Team
•Created by divby0 on 5/9/2023 in #help
Many-to-Many joins results in weird values
Hey, I am new to Prisma, switching here from prisma so I can use a typesafe orm with D1 properly. I am trying to return a many-to-many joined result:
This already returns a correct structure:
The weird things are:
- the name field of the user is not set (it's undefined in reality, if I use sqlite to look at the row), but my (maybe wrong) query fills it with the user's email??
- the teams object has only undefined values in it even though id as well as name are set
- I'd like to not select the password field of the user, how can I do that? I tried looking up partial selects in combination with joined fields, but nothing that I tried worked
I'd really appreciate help 🙂 drizzle really looks cool, I just have to learn a few more things, I guess.
PS: if that matters, I am using the sqlite / D1 variant of drizzle 🙂
23 replies