Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

APP PROXY RESPONDS WITH 404, NOT WORKING

APP PROXY RESPONDS WITH 404, NOT WORKING

Manpreet_singh_
Visitor
3 0 0

Hi everyone, 

 

I'm trying to get data from an external database and I'm calling an API through APP PROXY.  But it returns 404. Tried every possible code and configurations but nothing works.

My APP PROXY SETTINGS ARE:

Subpath prefix: a
Subpath: c

PROXY URL: https://my-domain.com



MY AJAX CODE IS:
*****************************************

jQuery(function(){ //document.ready
   jQuery.get('/a/c', function( data ) {
     alert ( "DATA: " + data );
   });

});

*****************************************

NOTE: 'a/c/{more}' also tried but not working.

Please help me to fix this, I'm new to Shopify family.

Thanks in advance

secure.png

Replies 4 (4)

OTM
Shopify Partner
696 170 252

Hi, @Manpreet_singh_ ,

This is Evita from On The Map.

 

404 is not fount error, it's not jquery's code that's wrong, it's API request URL that has no response.

Make sure API request has body response, something like this:

 

ctx.body = {
   success: true,
   data: {
name: 'John',
age: 18
} }

 

Best,
Evita

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!
Manpreet_singh_
Visitor
3 0 0

Hey, 

I know it's not a jquery error, The path we are trying to access is not available. 
But as I mentioned I've set route "\a\c" to call external route but that didn't work.

BTW thanks for the quick response.  Hope we are on the same track.

 

Manpreet_singh_
Visitor
3 0 0

Hey, 

I know it's not a jquery error, The path we are trying to access is not available. 
But as I mentioned I've set route "\a\c" to call external route but that didn't work.

BTW thanks for the quick response.  Hope we are on the same track.

OTM
Shopify Partner
696 170 252

Can you add routes "\a\c" code? What response you should have if the page was found?

On The Map Marketing | Developing custom Shopify Sites & Apps is our thing

- Install our latest app Accessibly - Makes your store accessible for everyone, helps to avoid fines
- Inc 5000 | Shopify Parners | 20+ stores launched | 300+ active clients
- Need help with your Shopify store? Reach out to us!