Skip to content

Commit 022c095

Browse files
Update env check (#8)
* simpler domain check for env * bump ver
1 parent f273a70 commit 022c095

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

client/src/config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
export const ENV =
2-
window.location.hostname === 'todo: change to prod domain'
1+
export const ENV = window.location.hostname.includes('stage.')
2+
? 'stage'
3+
: window.location.hostname === 'todo: change to prod domain'
34
? 'prod'
4-
: window.location.hostname.includes('todo: change to non prod matcher')
5-
? 'stage'
6-
: window.location.port === '4173'
7-
? 'test'
8-
: 'dev';
5+
: window.location.port === '4173'
6+
? 'test'
7+
: 'dev';
98

109
export const getServerUrl = () => {
1110
switch (ENV) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "create-react-spa-cloudflare",
33
"type": "module",
4-
"version": "0.0.22",
4+
"version": "0.0.23",
55
"description": "Starter package for a React SPA with Cloudflare Pages, Workers, and KV",
66
"bin": "./bin/cli.js",
77
"scripts": {

0 commit comments

Comments
 (0)