Update fetch URLs and set app base URL
The localhost:8080 server references in fetch calls within verify_mail.tsx and contact.tsx files have been updated to localhost:8002. Furthermore, the application base URL has been set to '/forms' in package.json, and in the BrowserRouter element within App.tsx, to ensure proper routing on the production server.
This commit is contained in:
parent
011fb9a282
commit
5301940a2f
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"homepage": "https://alttd.com/forms",
|
||||||
"name": "forms",
|
"name": "forms",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
@ -21,7 +22,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "set \"PUBLIC_URL=/forms\" && react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ function App() {
|
||||||
return (
|
return (
|
||||||
<div className="app-container">
|
<div className="app-container">
|
||||||
<Header/>
|
<Header/>
|
||||||
<BrowserRouter>
|
<BrowserRouter basename="/forms">
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<Home/>}/>
|
<Route path="/" element={<Home/>}/>
|
||||||
<Route path="/contact" element={<ContactForm/>}/>
|
<Route path="/contact" element={<ContactForm/>}/>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ const ContactForm = () => {
|
||||||
|
|
||||||
const handleSubmit = async (e: FormikValues) => {
|
const handleSubmit = async (e: FormikValues) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('http://localhost:8080/api/contact/submitContactForm', {
|
const response = await fetch('http://localhost:8002/api/contact/submitContactForm', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ const VerifyMail: FC = () => {
|
||||||
eMail: email
|
eMail: email
|
||||||
}
|
}
|
||||||
console.log(verificationData);
|
console.log(verificationData);
|
||||||
fetch('http://localhost:8080/api/verify_email/form', {
|
fetch('http://localhost:8002/api/verify_email/form', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user