App reviews, troubleshooting, and recommendations
Hello,
I'm using the Shopify CLI3 and have the React NodeJS starter template. For the tunnel I'm using ngrok.
I'm trying to call an API from the server and send the data back to the frontend (my app extension).
But I'm getting an error: Mixed Content: The page at 'https://route-to-ngrok.ngrok-free.app/products/t-shirt' was loaded over HTTPS, but requested an insecure resource 'http://route-to-ngrok.ngrok-free.app/password'. This request has been blocked; the content must be served over HTTPS.
I'm doing my API call like this:
extensions/my-extension/blocks/stock_light.liquid
<script>
console.log('fetch running12345678')
fetch('/apps/stock-light-inventory/get-inventory/' + "1234567", {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'ngrok-skip-browser-warning': 'true'
},
})
.then(response => response.json())
.then(data => {
console.log('data is:')
console.log(data)
});
</script>
app.get('/api/get-inventory/:variant_id', (req, res) => {
// Respond with the data
console.log('gettin here')
res.status(200).send("sucess")
});
Hi, @phillip12
Do you fix this issue or do you have any idea about this since I am facing the same issue now?
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024