Packages
shopifex
0.3.5
2.4.0
2.3.0
2.2.2
2.2.1
2.2.0
2.1.20
2.1.19
2.1.18
2.1.17
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.10
2.1.9
2.1.8
2.1.7
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
1.1.1
1.1.0
1.0.1
1.0.0
0.6.2
0.6.1
0.6.0
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Phoenix boilerplate for Shopify Embedded App SDK
Current section
Files
Jump to
Current section
Files
lib/shopifex_web/routes.ex
defmodule ShopifexWeb.Routes do
defmacro pipelines do
quote do
pipeline :shopify_browser do
plug(:accepts, ["html"])
plug(:fetch_session)
plug(Shopifex.Plug.FetchFlash)
plug(:protect_from_forgery)
plug(:put_secure_browser_headers)
plug(Shopifex.Plug.LoadInIframe)
end
pipeline :shopify_session do
plug(Shopifex.Plug.ShopifySession)
end
pipeline :shopify_entrypoint do
plug(Shopifex.Plug.ShopifyEntrypoint)
end
pipeline :shopify_webhook do
plug(:fetch_session)
plug(Shopifex.Plug.FetchFlash)
plug(Shopifex.Plug.ShopifyWebhook)
end
pipeline :admin_links do
plug(:accepts, ["json"])
plug(:fetch_session)
plug(Shopifex.Plug.FetchFlash)
plug(Shopifex.Plug.LoadInIframe)
end
end
end
defmacro shopifex_admin() do
quote do
scope "/", ShopifexWeb do
pipe_through([:shopify_browser])
resources("/plans", PlanController)
resources("/grants", GrantController)
end
end
end
defmacro auth_routes(app_web_module \\ ShopifexWeb) do
quote do
scope "/auth", unquote(app_web_module) do
pipe_through([:shopify_browser, :shopify_entrypoint])
get("/", AuthController, :auth)
get("/install", AuthController, :install)
get("/update", AuthController, :update)
end
end
end
defmacro payment_routes(app_web_module \\ ShopifexWeb) do
quote do
scope "/payment", unquote(app_web_module) do
pipe_through([:shopify_browser, :shopify_session])
get("/show-plans", PaymentController, :show_plans)
post("/select-plan", PaymentController, :select_plan)
get("/complete", PaymentController, :complete_payment)
end
end
end
end