Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Mar 28, 2023
1 parent 8487f7c commit 8bf1e9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
## Cloudlfare worker for redirection.io

Look at our documentation about cloudflare integration here : [https://redirection.io/documentation/developer-documentation/cloudflare-workers-integration](https://redirection.io/documentation/developer-documentation/cloudflare-workers-integration)
Look at our documentation about our Cloudflare integration here: [https://redirection.io/documentation/developer-documentation/cloudflare-workers-integration](https://redirection.io/documentation/developer-documentation/cloudflare-workers-integration)

### Pushing to cloudflare
### Pushing to Cloudflare

You can also directly push this repository to a cloudflare worker, but you will still need a redirection io account to do so:
You can also directly push this repository to a cloudflare worker, but you will still need a redirection.io account to do so:

1. You need to have wrangler installed: `npm install -g wrangler`
2. Login or configure your api token for cloudflare `wrangler login`
3. Copy file `wrangler.toml.dist` to `wrangler.toml` and replace needed value
4. Push your redirection io token as a secret value `wrangler secret put REDIRECTIONIO_TOKEN` and enter you redirection io project key when asked (available in your the instance panel of your project)
5. Publish your worker: `wrangler publish`
1. You need to have wrangler 2 installed: `npm install -g wrangler`
2. Login or configure the Cloudflare API token: `wrangler login`
3. Copy the file `wrangler.toml.dist` to `wrangler.toml`, and replace the value
4. Push the redirection.io project key as a secret value: `wrangler secret put REDIRECTIONIO_TOKEN` (enter the project key when asked to do so - this key can be found on the instance panel in the manager)
5. Publish the worker: `wrangler publish`

## License

Expand Down
5 changes: 3 additions & 2 deletions wrangler.toml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# see documentation at https://redirection.io/documentation/developer-documentation/cloudflare-workers-integration#manually-deploying-the-cloudflare-worker

account_id = "account_id"
name = "worker_name_on_cloudflare"
route = "route_name"
route = "{ pattern = "*example.com/*", zone_id = "abcdef0123456789abcdef0123456789" }"
workers_dev = false
compatibility_date = "2022-01-20"
main = "build/worker/shim.mjs"

[vars]
WORKERS_RS_VERSION = "0.0.15"
REDIRECTIONIO_ADD_HEADER_RULE_IDS = false
REDIRECTIONIO_INSTANCE_NAME = "instance_name_on_redirectionio"
REDIRECTIONIO_TIMEOUT = 5000
Expand Down

0 comments on commit 8bf1e9d

Please sign in to comment.