Build and deployment
Build and publish a store to Cloudflare Workers with the CLI.
Cloudflare Workers is the available target. ecomiq build and ecomiq deploy
always build with the workerd runtime, even when development uses Node.
Configuration
import { defineConfig } from "@ecomiq/storefront/config";
export default defineConfig({
domain: "marketplace",
deploy: {
target: "cloudflare",
name: "andina-market",
routes: [{ pattern: "shop.example.com", custom_domain: true }],
},
env: {
PUBLIC_SUPPORT_EMAIL: "support@example.com",
},
});When deploy.name is omitted, the CLI derives the name from domain.
deploy.routes accepts the same shapes as Wrangler's routes:
- A string.
{ pattern, zone_id, custom_domain? }.{ pattern, zone_name, custom_domain? }.{ pattern, custom_domain, enabled?, previews_enabled? }.
Build
pnpm buildThe output is written to .ecomiq/dist. The CLI also generates the server
entry and Wrangler configuration. Do not edit them.
Deployment
Authenticate Wrangler with a local session or CLOUDFLARE_API_TOKEN, then run:
pnpm deploydeploy performs a fresh build and then runs wrangler deploy with the
generated configuration.
Variables and secrets
env is written to the Worker's vars and is visible as plain-text
configuration. Use it only for non-sensitive values.
Configure tokens, private keys, and BETTER_AUTH_SECRET as Cloudflare Secrets,
not inside ecomiq.config.js.
Health checks
The generated Worker responds on:
| Route | Use |
|---|---|
/ping | Simple check; returns ok. |
/__ecomiq/health | Also verifies that settings can be loaded. |
The CLI has no deployment flags
There is no --name, --env, --route, or --dry-run. Declare the name,
routes, and variables in ecomiq.config.js.