Integration
Cloudflare
Run bknd inside Cloudflare Worker
Installation
Create a new cloudflare worker project by following the official guide, and then install bknd as a dependency:
Serve the API
For more information about the connection object, refer to the Setup guide.
Now run the worker:
And confirm it works by opening http://localhost:8787 in your browser.
Serve the Admin UI
Now in order to also server the static admin files, you have to modify the wrangler.toml
to
include the static assets:
And then modify the worker entry as follows:
Adding custom routes
You can also add custom routes by defining them after the app has been built, like so: