From 0a35b4a7f137db6e6d58dc535b8209375d1be584 Mon Sep 17 00:00:00 2001 From: Nick Carbone Date: Wed, 7 May 2025 15:23:27 -0500 Subject: [PATCH 1/2] simpler domain check for env --- client/src/config.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/client/src/config.ts b/client/src/config.ts index 7ee0434..64c07b5 100644 --- a/client/src/config.ts +++ b/client/src/config.ts @@ -1,11 +1,10 @@ -export const ENV = - window.location.hostname === 'todo: change to prod domain' +export const ENV = window.location.hostname.includes('stage.') + ? 'stage' + : window.location.hostname === 'todo: change to prod domain' ? 'prod' - : window.location.hostname.includes('todo: change to non prod matcher') - ? 'stage' - : window.location.port === '4173' - ? 'test' - : 'dev'; + : window.location.port === '4173' + ? 'test' + : 'dev'; export const getServerUrl = () => { switch (ENV) { From cc2ffc8cc2afe47eb842fc1a11a9ca1fb63981ef Mon Sep 17 00:00:00 2001 From: Nick Carbone Date: Wed, 7 May 2025 15:24:18 -0500 Subject: [PATCH 2/2] bump ver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5fe005..4b86ba6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "create-react-spa-cloudflare", "type": "module", - "version": "0.0.22", + "version": "0.0.23", "description": "Starter package for a React SPA with Cloudflare Pages, Workers, and KV", "bin": "./bin/cli.js", "scripts": {