From 66a9dbea5ca5524bad8b6ac4ebf9b6615e776a13 Mon Sep 17 00:00:00 2001 From: aarbit Date: Tue, 25 Jun 2024 15:30:55 -0500 Subject: [PATCH] Moves API URL to env config files for ease of testing and production deployments --- .env | 1 + .env.production | 1 + src/Config.ts | 4 +--- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 .env create mode 100644 .env.production diff --git a/.env b/.env new file mode 100644 index 0000000..ca9963a --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VITE_API_URL=http://localhost:8080 \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..00fb3c8 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VITE_API_URL=https://ppapi.halfbinary.net \ No newline at end of file diff --git a/src/Config.ts b/src/Config.ts index f2d18c1..557812a 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -1,4 +1,2 @@ -//const hostName = "http://192.168.187.129:8082" -//const hostName = "http://localhost:8080" -const hostName = "http://192.168.187.118:8080" +const hostName = import.meta.env.VITE_API_URL export default hostName