diff --git a/.env.development b/.env.development deleted file mode 100644 index 15895be..0000000 --- a/.env.development +++ /dev/null @@ -1,3 +0,0 @@ -VITE_API_URL=https://localhost:5001/ -VITE_GOOGLE_CLIENT_ID=468391910875-78sfopq1t12ulrv4f5vj227j45guuj66.apps.googleusercontent.com -VITE_FACEBOOK_APP_ID=1202001717489038 diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..f6376e0 --- /dev/null +++ b/.env.dist @@ -0,0 +1,4 @@ +VITE_API_URL=https: +VITE_STRIPE_API_KEY= +VITE_GOOGLE_CLIENT_ID= +VITE_FACEBOOK_APP_ID \ No newline at end of file diff --git a/.env.production b/.env.production deleted file mode 100644 index f8bc03d..0000000 --- a/.env.production +++ /dev/null @@ -1,3 +0,0 @@ -VITE_API_URL=https://hutopy.azurewebsites.net/ -VITE_GOOGLE_CLIENT_ID=468391910875-78sfopq1t12ulrv4f5vj227j45guuj66.apps.googleusercontent.com -VITE_FACEBOOK_APP_ID=1202001717489038 diff --git a/.gitignore b/.gitignore index 93729a3..10a5635 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,8 @@ coverage *.sw? *.tsbuildinfo + +# .Env files +.env.development +.env.production +.env \ No newline at end of file diff --git a/src/views/StripePayment.vue b/src/views/StripePayment.vue index f0b8536..e3300ec 100644 --- a/src/views/StripePayment.vue +++ b/src/views/StripePayment.vue @@ -55,8 +55,7 @@ const isPaymentDialogActive = ref(false); var checkout; onMounted(async () => { - // I removed api key to push. Need to get it from backend. - stripe = await loadStripe(''); + stripe = await loadStripe(import.meta.env.VITE_STRIPE_API_KEY); }) const fetchClientSecret = async () => { diff --git a/vite.config.js b/vite.config.js index 755350d..2cdb8cb 100644 --- a/vite.config.js +++ b/vite.config.js @@ -18,7 +18,8 @@ export default defineConfig(({ mode }) => { }, define: { // Define a global constant __APP_ENV__ based on loaded environment variables - VITE_API_URL: JSON.stringify(env.VITE_API_URL) + VITE_API_URL: JSON.stringify(env.VITE_API_URL), + VITE_STRIPE_API_KEY: JSON.stringify(env.VITE_STRIPE_API_KEY) } } })