I'm sure this is a newbee question, but I just can't figure this out based on the official documentation.
I have my first app up and running on a remote server, I have all the oauth done. I can access store data from my remote app now.
My next step is to setup app proxy so I'm able to make ajax request from store frontend to my app backend for communication.
Now, my conf in app dashboard is
Sub path prefix: app
On my remote server, I have http://app.myapp.com/ajax/test/ returns a simple string back. (python backend, url tested to be working)
When I'm access https://myshop.myshopify.com/apps/ajax/test. It gives me 404. I double check on my app server. No http request was received. Can anyone help me understand what's going wrong with this setup? I couldn't find anything to help me in the documentation.
Thank you guys in advance.
You are getting a 404 because https://myshop.myshopify.com/apps/ajax/test isn't a valid proxy page. You can set it to https://myshop.myshopify.com/apps/ajax, but there can't be an additional slash at the end of your path. The path in the shop doesn't need to match the path in your app. Our documentation has some sample code you can reference.
Thanks for you reply. What I got from the documentation is https://example-store.myshopify.com/apps/my-app-proxy/app_path
In my config:
example-store.myshopify.com = https://myshop.myshopify.com
my-app-proxy = ajax
app_path = test
What's the difference between the documentation and my example? https://myshop.myshopify.com/apps/ajax/test
You're absolutely right! I just tested it on my test app, and it should work with the third slash in the path. Can you let me know the shop and app name you are trying this with so I can take a look?
Assuming you have a route in your app at http://app.myapp.com/ajax/test, and the proxy page is set up properly in the admin of the shop you are using, you should be good.
Here's my app http://app.williamswitzer.com/ajax/test/ , which is working.
Sub path prefix: apps
Proxy Url: http://app.williamswitzer.com/ajax
Thank you for looking at this. What I'm expecting is https://william-switzer.myshopify.com/apps/ajax/test will forward http request to http://app.williamswitzer.com/ajax/test/ if I understand the documentation correctly.
It looks like the proxy page in your shop admin is setup at /apps/app rather than /apps/ajax. If I go to https://william-switzer.myshopify.com/apps/app/test, it works. You can update the address in your admin here: