我有一个脚本标签,我在我的应用程序中使用shopify_app初始化器将其加载到 Shopify 商店中,如下所示:
ShopifyApp.configure do |config|
config.application_name = "My App"
config.api_key = THE_KEY
config.secret = THE_SECRET
config.scope = "read_script_tags, write_script_tags"
config.embedded_app = true
config.scripttags = [{event: 'onload', src: 'https://theappname.herokuapp.com/scripts/myscript.js'}]
end
商店端我在控制台中收到此消息:
Loading failed for the <script> with source “https://theappname.herokuapp.com/scripts/myscript.js?shop=theshopname.myshopify.com”.
在应用程序日志中,我收到此错误:
ActionController::RoutingError (No route matches [GET] "/scripts/myscript.js")
ScripttagsManager 是否不像 WebhooksManager 那样处理脚本标签的路由?
是否必须为每个脚本标记手动创建路由?
我在这里错过了什么?
你确实需要做一条路线。您确实需要提供 src 的代码。有道理吧?