Module: WolfCore::Barton::Routing
- Defined in:
- lib/wolf_core/application/barton/routing.rb
Constant Summary collapse
- PATH_TO_FUNCTION_NAME_MAPPING =
{ 'barton/import/jobseeker' => 'BartonImportJobseeker', 'barton/export/jobseeker' => 'BartonExportJobseeker', 'barton/import/order' => 'BartonImportOrder', 'barton/export/order' => 'BartonExportOrder', 'barton/import/order_description' => 'BartonImportOrderDescription', 'barton/import/order_application' => 'BartonImportOrderApplication', 'barton/export/order_application' => 'BartonExportOrderApplication', 'barton/import/contract' => 'BartonImportContract', 'barton/export/contract' => 'BartonExportContract', 'barton/export/jobseeker/file' => 'BartonExportJobseekerFile', 'barton/import/jobseeker/file' => 'BartonImportJobseekerFile', 'barton/manage_assign_package' => 'BartonManageAssignPackage', 'barton/export/credential' => 'BartonExportCredential', }
Instance Method Summary collapse
Methods included from ExceptionOperations
Methods included from LambdaFunctionOperations
#deep_parse_json, #get_event_params, #invoke_lambda, #parse_lambda_response, #result_to_response, #validate_lambda_response
Methods included from HttpOperations
#async_http_get, #async_http_post, #async_http_put, #http_get, #http_post, #http_put, #parse_http_response, #safe_http_get, #safe_http_post, #safe_http_put, #validate_http_response
Methods included from LoggingUtils
Methods included from AsyncUtils
Instance Method Details
#route_event_request(path:, body:) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/wolf_core/application/barton/routing.rb', line 24 def route_event_request(path:, body:) environment = ENV['ENVIRONMENT'] if environment == 'production' function_name = PATH_TO_FUNCTION_NAME_MAPPING[path] raise_service_error("Function name not found for path: #{path}") if function_name.blank? invoke_lambda( function_name: function_name, payload: body, ) else domain_url = ENV['CURRENT_SAM_URL'] async_http_post(url: "#{domain_url}/#{path}", body: body) end end |