mirror of
https://github.com/KevinMidboe/planetposen.git
synced 2025-10-29 09:40:31 +00:00
Custom route for product details when localhost.
This commit is contained in:
@@ -66,7 +66,11 @@ export default {
|
|||||||
|
|
||||||
const productSlug = this.$route.params.slug
|
const productSlug = this.$route.params.slug
|
||||||
|
|
||||||
fetch(`http://localhost:30010/api/product/${ productSlug }`)
|
let url = `/api/products/${ productSlug }`;
|
||||||
|
if (window.location.href.includes('localhost'))
|
||||||
|
url = 'http://localhost:30010'.concat(url)
|
||||||
|
|
||||||
|
fetch(url)
|
||||||
.then(resp => resp.json())
|
.then(resp => resp.json())
|
||||||
.then(product => this.product = product);
|
.then(product => this.product = product);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user