How to Handle Multiple Endpoints in App Proxy for a Remix App?

Topic summary

A developer is building a Remix app with multiple API endpoints (e.g., /api/getWishlistData, /api/getProductDetails) that need to be called from a Shopify theme app extension. To avoid exposing the app URL, they want to use Shopify’s App Proxy feature, but discovered it only allows configuring a single proxy path in the Partner Dashboard.

Solution provided:
Multiple respondents confirmed that Shopify’s App Proxy doesn’t support multiple endpoint paths directly. The recommended workaround is to:

  • Use a single proxy path with an action query parameter to differentiate requests
  • Route logic based on the parameter value using a switch statement in the loader function

Example approach:

const action = url.searchParams.get('action');
switch (action) {
  case 'getWishlistData': ...
  case 'getProductDetails': ...
}

This allows handling multiple endpoints through one proxy configuration while maintaining clean separation of logic.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Hi everyone,

I’m building a Remix app that includes multiple endpoints. These endpoints are called from a Shopify theme app extension. Normally, this requires referencing the full app URL for each request. To avoid exposing the app URL, I decided to use Shopify’s App Proxy feature.

However, I’ve noticed that the App Proxy configuration in the Shopify Partner Dashboard allows only one proxy path. Since my app has multiple endpoints (e.g., /api/getWishlistData, /api/getProductDetails, etc.), I’m unsure how to handle this limitation.

Has anyone dealt with a similar situation?

  • Is there a way to route multiple endpoints through a single App Proxy path?

  • How do you structure your Remix app to handle these proxy requests correctly?

Any guidance or examples would be greatly appreciated!

Hi there!

A simple way to work around the single App Proxy path limitation is to use an action query parameter on the proxy URL — and route your logic based on its value.

Example:

export async function loader({ request }: LoaderArgs) {
  const url = new URL(request.url);
  const action = url.searchParams.get('action');

  switch (action) {
    case 'getWishlistData':
      return json(await handleGetWishlistData());
    case 'getProductDetails':
      return json(await handleGetProductDetails());
    default:
      return new Response('Invalid action', { status: 400 });
  }
}
1 Like

Hi @greeshma

At present, Shopify app proxy does not support multiple endpoints, which can be determined by URL parameters

export const loader = async ({request, params}) => {
  const {admin} = await authenticate.admin(request);
  const topic = params.topic;
  switch (topic) {
    case "ORDERS_CREATE":
      orderEventEmitter.emit("order-create", payload);
      break;
    case "ORDERS_UPDATED":
      orderEventEmitter.emit("order-updated", payload);
      break;
    default:
  }
  ...
};
1 Like