From 828b6a5d3206fcbc800dcb029499f8688c50fc53 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Sun, 17 Sep 2023 06:27:42 +0800 Subject: [PATCH] Frontend added environment --- react-frontend/.env.example | 1 + react-frontend/src/App.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 react-frontend/.env.example diff --git a/react-frontend/.env.example b/react-frontend/.env.example new file mode 100644 index 0000000..6ebe13a --- /dev/null +++ b/react-frontend/.env.example @@ -0,0 +1 @@ +backend_url=https://s.tzgyn.com diff --git a/react-frontend/src/App.tsx b/react-frontend/src/App.tsx index 7a6d063..c72bf67 100644 --- a/react-frontend/src/App.tsx +++ b/react-frontend/src/App.tsx @@ -26,7 +26,7 @@ import { useToast } from '@/components/ui/use-toast' import { useEffect, useState } from 'react' -const backend_url = 'http://192.168.100.40:3000' +const backend_url = process.env.backend_url ?? 'http://192.168.100.40:3000' type Shortener = { id: number