Production
To build the api, run the relevant command per runtime:
bun run builddeno task buildnpm run build
Preview
Section titled “Preview”To preview the api with vite:
bun run previewdeno task previewnpm run preview
To preview the api in your runtime’s environment:
bun run startdeno task startwrangler dev
Deploy
Section titled “Deploy”For Cloudflare, you can deploy your api with wrangler deploy.
Cloudflare manages HTTPS for Workers. For Bun and Deno, prefer terminating HTTPS at a managed load balancer, ingress, Caddy, or nginx and keeping the application listener private. Set public_origin on the Xink instance so origin checks and secure cookies use the external HTTPS URL.
For example, Caddy obtains and renews the certificate while proxying to a private application listener:
api.example.com { reverse_proxy 127.0.0.1:3000}const api = new Xink({ public_origin: 'https://api.example.com' })If a reverse proxy is not available, the Bun and Deno adapters can load certificate and key files directly. Xink does not issue or renew certificates.