I’m trying to connect a worker (that has a site) to a durable object.
However, Wrangler still doesn’t support durable objects, so you have to stitch together shell scripts to talk to the API to deploy DO workers. Going down that path, you eventually have to recreate the bindings that
[site] creates dynamically during
wrangler publish. However, the metadata.json bindings for sites seem unrealistic to write by hand (__STATIC_CONTENT + __STATIC_CONTENT_MANIFEST).
wrangler publish with the sites config destroys the binding to the durable object’s namespace. Running
/workers/scripts/$SCRIPT with a hand-written
metadata.json destroys the bindings for sites.
Ideally, I’d like to run
wrangler publish and then additively create the durable object bindings on the worker, so it would both be able to host a site and talk to a durable object. I haven’t yet found a way to make that possible though.
/cc @denis.truffaut since you seem to be exploring similar things.