TL;DR version
- Configure
.env
file according to your environment specifics (see.env-example
file). npm install
- Add
NPM_TOKEN
environment variable with the value we provided you with. -
npm run start
to start the SSR server. -
npm run export:deploy
npm run export
to run static export if used only with the UniformDeployDeploy-only capability. -
npm run export:deploy-and-optimize
to run static export if used with the Optimize capability. -
npm run export:esi
to run static export if used with the Uniform Optimize capability.
Cloudflare worker setup
-
Install
@cloudflare/wrangler
npm package
npm i @cloudflare/wrangler@1.19.2 -g
-
Create a Cloudflare account: https://dash.cloudflare.com/login
-
Create a Cloudflare API token:
- Follow the link: https://dash.cloudflare.com/profile/api-tokens
- Select "Create Token" button
- Select "Edit Cloudflare Workers" among API token templates
- In a new "Create Token" window don't change any Permissions (they are predefined correctly); indicate "All Accounts" in Account Resources section and "All Zones" in Zone Resources section. Client IP Address Filtering section can be skipped.
- Press "Continue To Summary" and then "Create Token" buttons.
- IMPORTANT! Copy and save your API Token somewhere. It only shown once after the initial setup.
- Finalize the worker setup: navigate to the Workers page (Click Workers link on the right pane on the Cloudflare main page) and click the Setup button next to your worker name; Choose to proceed with free account on the next page
-
Enable config:
uniform-mvc-kit.Uniform.Deployment.Hosted.z.Cloudflare.config.disabled
and specify required variables:- update
CF_ACCOUNT_ID
with your Cloudflare account ID - update
CF_API_TOKEN
with created Cloudflare API token - update
CF_WORKER_NAME
with preferable worker name
- update
-
If incremental deploy configured: enable config:
uniform-mvc-kit.Uniform.Deployment.Incremental.z.Cloudflare.config.disabled
and specify required variables:- update
PublicUrl
with your Cloudflare public url
- update
-
Default Cloudflare worker domain:
https://<WORKER-NAME>.<CLOUDFLARE-ACCOUNT-NAME>.workers.dev
0 commit comments