Update backend URLs to use environment variables
Replaced hardcoded backend URLs with environment variables in contact, apply, and verify_email components. Added .env.development and .env.production files to define the base URLs for different environments. This improves flexibility and allows easier configuration changes.
This commit is contained in:
parent
997baae4d3
commit
9a281ed76c
1
.env.development
Normal file
1
.env.development
Normal file
|
|
@ -0,0 +1 @@
|
|||
REACT_APP_BACKEND_BASE_URL=http://localhost:8002
|
||||
1
.env.production
Normal file
1
.env.production
Normal file
|
|
@ -0,0 +1 @@
|
|||
REACT_APP_BACKEND_BASE_URL=https://forms-backend.alttd.com
|
||||
|
|
@ -124,7 +124,7 @@ export const apply: FormData = {
|
|||
required: false,
|
||||
},
|
||||
],
|
||||
backend: 'https://forms-backend.alttd.com/api/apply/staffApplication',
|
||||
backend: `${process.env.REACT_APP_BACKEND_BASE_URL}/api/apply/staffApplication`,
|
||||
userInput: {username: '', email: '', discord: '', pc_requirements: ''
|
||||
, age: '', pronoun: '', join_date: '', avg_time: '', available_days: '', available_time: '', staff_experience: ''
|
||||
, plugin_experience: '', why_staff: '', expectations_mod: '', other: ''
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export const contact: FormData = {
|
|||
required: true,
|
||||
},
|
||||
],
|
||||
backend: 'https://forms-backend.alttd.com/api/contact/submitContactForm',
|
||||
backend: `${process.env.REACT_APP_BACKEND_BASE_URL}/api/contact/submitContactForm`,
|
||||
userInput: {username: '', email: '', question: ''},
|
||||
spec: Yup.object().shape({
|
||||
username: Yup.string()
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const VerifyMail: FC = () => {
|
|||
eMail: email
|
||||
}
|
||||
console.log(verificationData);
|
||||
fetch('https://forms-backend.alttd.com/api/verify_email/form', {
|
||||
fetch(`${process.env.REACT_APP_BACKEND_BASE_URL}/api/verify_email/form`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user