Class: Blocks::Sdk::Rails::TranslationsRouteMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/blocks/sdk/rails/translations_route_mapper.rb

Overview

Maps routes specifically for Translations service Other services should implement their own route mappers

Class Method Summary collapse

Class Method Details

.draw(router) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/blocks/sdk/rails/translations_route_mapper.rb', line 9

def self.draw(router)
  router.scope path: "blocks" do
    # API endpoints for frontend - translations service only
    router.get "api/translations", to: "blocks/sdk/rails/controllers/api/translations#index", as: :api_translations

    # Webhook endpoint for translations service cache invalidation
    router.post "webhooks/translations", to: "blocks/sdk/rails/controllers/translations_webhooks#create", as: :webhooks_translations
  end
end