diff --git a/web/config/routes.rb b/web/config/routes.rb index 8b96fb6..d8389dd 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -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 @@ -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