Yep the routing is working great, only thing i needed to add in my main domain:
[[redirects]]
from = "/app1"
to = "https://determined-curie-bc9b33.netlify.app/"
status = 200
BUT, having issues with axios posting to app1 from my main domain www.marius.dev/app1.
So if you open www.marius.dev/app1 you will see 3 buttons that onClick send post to https://determined-curie-bc9b33.netlify.app but the first two wont work and only the last button will because in axios i have hardcoded my actual domain name.
Full code app1
:
import React from 'react'
import axios from 'axios'
export default function App() {
const currentHost = window.location.href
console.log(window.location)
console.log('Current Host', currentHost)
const submitLocalHost = async (value, actions) => {
await axios
.post(`${currentHost}_base`)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
}
const submitLocalHostWithS = async (value, actions) => {
await axios
.post(`_base`)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
}
const submitNetlifyApp = async (value, actions) => {
await axios
.post(`https://determined-curie-bc9b33.netlify.app/_base`)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
}
return (
<>
<button type="button" onClick={submitLocalHost}>
Test 1
</button>
<br />
<button type="button" onClick={submitLocalHostWithS}>
Test 2
</button>
<br />
<button type="button" onClick={submitNetlifyApp}>
Netlify App
</button>
</>
)
}
Ofcourse there is no issues when i do this from the actual app1 domain https://determined-curie-bc9b33.netlify.app/
So is there a way for me to have some kind of variable or maybe something else in config so that between my dev and prod environment i don’t need to think about what variable i need place in axios when doing these type of re-direct/proxy?