当您在 Shopify 中使用应用代理设置表单时,您需要告诉表单将数据发送到哪里(操作 URL)。例如:
import { redirect } from "@remix-run/node";
import { authenticate } from "~/shopify.server";
export async function loader({ request }) {
const { liquid } = await authenticate.public.appProxy(request);
return liquid(
<form method="post" action="/apps/proxy/my-action">
<input type="text" name="field" />
<button type="submit">Submit</button>
</form>
);
}
但问题是商家可以更改应用程序代理所在的路径。如果他们这样做,表单的操作 URL 将中断,因为它指向旧路径。
我期待我们是否可以从已安装的商店获取代理网址