Skip to content

Commit

Permalink
Update routes
Browse files Browse the repository at this point in the history
Define specific webhook routes first

Otherwise the /webhooks route defined in shopify api will clobber the specific routes
  • Loading branch information
lizkenyon committed Aug 8, 2024
1 parent b73bd9e commit 50cad83
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
Rails.application.routes.draw do
root to: "home#index"

mount ShopifyApp::Engine, at: "/api"
get "/api", to: redirect(path: "/") # Needed because our engine root is /api but that breaks frontend routing

# If you are adding routes outside of the /api path, remember to also add a proxy rule for
# them in web/frontend/vite.config.js

# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

scope path: :api, format: :json do
Expand All @@ -26,6 +20,12 @@
end
end

mount ShopifyApp::Engine, at: "/api"
get "/api", to: redirect(path: "/") # Needed because our engine root is /api but that breaks frontend routing

# If you are adding routes outside of the /api path, remember to also add a proxy rule for
# them in web/frontend/vite.config.js

# Any other routes will just render the react app
match "*path" => "home#index", via: [:get, :post]
end

0 comments on commit 50cad83

Please sign in to comment.