I followed a YT video on how to set up an app proxy. I also looked at a lot of Shopify forum posts to no avail
I get this error in the dev tools console (I think the Youtuber deleted my comment when I tried asking about this error)
GET https://testingwishlist.myshopify.com/auth/login 404 (Not Found)
and this from my terminal
GET /app/proxy/?shop=testingwishlist.myshopify.com&logged_in_customer_id=&path_prefix=%2Fapps%2Fproxytest×tamp=1718050314&signature=819a839
ceb80bf73ef9b978ad39c7ddcf7324744ea00b4d06710ffefb5cbff4f 302
Here is my proxy.liquid and my proxy.js
<body>
<button onclick="testProxy()">test proxy</button>
</body>
<script async src={{ "proxy.js" | asset_url }} defer></script>
{% schema %}
{
"name": "Proxy Embed",
"target": "section",
"settings": [
{
"type": "header",
"content": "Proxy button to customer wish list"
}
]
}
{% endschema %}
function testProxy() {
return new Promise((resolve, reject) => {
fetch("https://testingwishlist.myshopify.com/apps/proxytest"), {
method: 'POST',
redirect: 'manual',
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
}
}
}).then((response) => {
console.log(response, 'response');
}).then((data) => {
resolve(data)
}).catch((error) => {
reject(error)
})
}
Here is my app.proxy.jsx which is in the routes folder
import { authenticate } from '../shopify.server'
import { Page } from '@shopify/polaris'
import { cors } from 'remix-utils'
import { json } from '@remix-run/node';
export const loader = async ({request}) => {
console.log('---hit app proxy----')
const {session} = await authenticate.public.appProxy(request)
return await cors(request, json({status: 200}))
}
const Proxy = () => {
return <Page>proxy </Page>
}
export default Proxy
The console.log in my app.proxy.jsx does turn up in the terminal along with the error, so I at least know that its connected to the fetch in proxy.js
My App proxy settings in Shopify Partner is :
Subpath prefix: apps
Subpath: proxytest
Proxy URL: https://journalists-attribute-slim-paste.trycloudflare.com/app/proxy
The URL changes each time I restart the app from the terminal, so I always make sure to update the Proxy URL
The App Proxy Url from the admin settings is: https://testingwishlist.myshopify.com/apps/proxytest
I did add this to my remix.config.js file but it didn’t change anything
serverDependenciesToBundle: [
/^remix-utils.*/,
],


