Class: Api::RootService
- Inherits:
-
Core::Service
- Object
- Sinatra::Base
- Core::Service
- Api::RootService
- Defined in:
- app/middleware/api/root_service.rb
Overview
Sinatra application which provides routing for the V1 API Automatically generates routes from the files listed under app/api/endpoints
This particular class handles the actual root response, other endpoints are handled by EndpointHandler
Defined Under Namespace
Modules: RootResponse
Constant Summary collapse
- ALL_SERVICES_AVAILABLE =
Note:
This is partly a hack but it suffices to keep the dynamic ability to write endpoints.
Dir .glob(File.join(Rails.root, %w[app api endpoints ** *.rb])) # rubocop:todo Rails/RootPathnameMethods .to_h do |file| handler = file.gsub(%r{^.+/(endpoints/.+).rb$}, '\1').camelize.constantize [handler.root.tr('/', '_'), handler] end
Constants inherited from Core::Service
Instance Attribute Summary
Attributes inherited from Core::Service
Method Summary
Methods inherited from Core::Service
after_all_actions, #api_path, api_version_path, before_all_actions, #handle_not_found!, #redirect_to, #redirect_to_multiple_locations