3

I have a Cloudflare Pages project (Built with Gatsby) that I wish to add a Durable Object to. Right now I can add workers by putting them into the functions directory of the project.

Cloudflare's documentation indicates I should be able to add a binding through the dashboard, but there is no option to do so.

I have tried adding a custom wrangler.toml to the project, but it does not seem to have any effect.

How can I add a Cloudflare Durable Object to the project?

major-mann
  • 2,602
  • 22
  • 37
  • 1
    Have been trying to do this myself without luck. The only option I've found so far is to create a separate Worker for the Durable Object and then bind to that from the Pages project. – smcstewart Feb 17 '23 at 14:07
  • That's the approach I have taken in the mean time – major-mann Feb 18 '23 at 15:26

1 Answers1

0

In the bindings, try setting like these:

{ name = "COORDINATOR", class_name = "BoardCoordinator", script_name="functions/board_coordinator.mts" }
Pepsin
  • 149
  • 1
  • 6