From 8a20d305b5460d3744dceb4bd2e1f605ab188a8f Mon Sep 17 00:00:00 2001 From: blaine-arcjet <146491715+blaine-arcjet@users.noreply.github.com> Date: Thu, 13 Jun 2024 07:47:28 -0700 Subject: [PATCH] chore(examples): Add ARCJET_ENV to Bun and SvelteKit env files (#970) Closes #969 Localhost IP addresses are only allowed in development mode now. Bun doesn't set `NODE_ENV` for you like Node does, so you need to set `ARCJET_ENV` in your environment file. The reason this checks **explicitly** for development environment is that we don't want to allow non-global IPs if users deploy there service and forget to set an environment. --- examples/bun-hono-rl/.env.local.example | 5 ++++- examples/bun-rl/.env.local.example | 3 +++ examples/sveltekit/.env.example | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/bun-hono-rl/.env.local.example b/examples/bun-hono-rl/.env.local.example index 0c183c7ac..98e20c802 100644 --- a/examples/bun-hono-rl/.env.local.example +++ b/examples/bun-hono-rl/.env.local.example @@ -1 +1,4 @@ -ARCJET_KEY= \ No newline at end of file +# Run Arcjet in development mode because Bun.sh doesn't explicitly +# set an environment variable like Node.js does +ARCJET_ENV=development +ARCJET_KEY= diff --git a/examples/bun-rl/.env.local.example b/examples/bun-rl/.env.local.example index b157ef219..98e20c802 100644 --- a/examples/bun-rl/.env.local.example +++ b/examples/bun-rl/.env.local.example @@ -1 +1,4 @@ +# Run Arcjet in development mode because Bun.sh doesn't explicitly +# set an environment variable like Node.js does +ARCJET_ENV=development ARCJET_KEY= diff --git a/examples/sveltekit/.env.example b/examples/sveltekit/.env.example index 0c183c7ac..302b0aab7 100644 --- a/examples/sveltekit/.env.example +++ b/examples/sveltekit/.env.example @@ -1 +1,4 @@ -ARCJET_KEY= \ No newline at end of file +# Run Arcjet in development mode because SvelteKit might not explicitly +# set an environment variable like Node.js does +ARCJET_ENV=development +ARCJET_KEY=