A space to discuss online store customization, theme development, and Liquid templating.
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
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
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.
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.
Can you add routes "\a\c" code? What response you should have if the page was found?