Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update router example
  • Loading branch information
ericdude4 committed Jun 21, 2021
1 parent f7f9435 commit f99b9ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -107,7 +107,7 @@ end

# Place your admin link endpoints in here
scope "/admin-links", MyAppWeb do
pipe_through [:admin_links, :shopify_webhook]
pipe_through [:shopify_admin_link]

get "/do-a-thing", AdminLinkController, :do_a_thing
end
Expand Down Expand Up @@ -254,9 +254,11 @@ defmodule MyAppWeb.AdminLinkController do
plug Shopifex.Plug.PaymentGuard, "premium_plan" when action in [:premium_function]

def premium_function(conn, _params) do
shop = Shopifex.Plug.current_shop(conn)

# Wow, much premium.
conn
|> send_resp(200, "success")
|> send_resp(200, "Hi there, #{shop.url}!")
end
end
```
Expand Down

0 comments on commit f99b9ca

Please sign in to comment.