diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb new file mode 100644 index 0000000..7d6e830 --- /dev/null +++ b/app/controllers/api_controller.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class ApiController < ActionController::API + # Por ahora hacer un echo de cada transacción + # + # @see {https://docutopia.tupale.co/sutty:nodemecu:api} + def transactions + render plain: params[:transaction_uuid], status: :ok + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 616ff5a..75f7187 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,11 +7,4 @@ class ApplicationController < ActionController::Base end def index end - - # Por ahora hacer un echo de cada transacción - # - # @see {https://docutopia.tupale.co/sutty:nodemecu:api} - def transactions - render plain: params[:transaction_uuid], status: :ok - end end diff --git a/config/routes.rb b/config/routes.rb index 79813eb..2fa4570 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,5 +6,5 @@ Rails.application.routes.draw do end mount Blazer::Engine, at: 'blazer' - post :transactions, to: 'application#transactions' + post :transactions, to: 'api#transactions' end