Sha256: 70f00a2ef78b6d823afa8543251bbe5e8f5ae8920415b8046d1854996b57f6e4
Contents?: true
Size: 1.45 KB
Versions: 14
Compression:
Stored size: 1.45 KB
Contents
module RackGraphql class Application def self.call( schema:, app_name: 'rack-graphql-service', logger: nil, context_handler: nil, re_raise_exceptions: false, log_exception_backtrace: RackGraphql.log_exception_backtrace, health_route: true, health_response_builder: RackGraphql::HealthResponseBuilder, health_on_root_path: health_route, root_path_app: nil, error_status_code_map: {} ) ::Rack::Builder.new do map '/graphql' do run RackGraphql::Middleware.new( app_name: app_name, schema: schema, context_handler: context_handler, re_raise_exceptions: re_raise_exceptions, logger: logger, log_exception_backtrace: log_exception_backtrace, error_status_code_map: error_status_code_map, ) end if health_route map '/health' do run ->(env) { health_response_builder.new(app_name: app_name, env: env).build } end map '/healthz' do run ->(env) { health_response_builder.new(app_name: app_name, env: env).build } end end if root_path_app map '/' do run root_path_app end elsif health_on_root_path map '/' do run ->(env) { health_response_builder.new(app_name: app_name, env: env).build } end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems