class FunctionsFramework::Server::HttpApp

@private

Public Class Methods

new(function, globals, config) click to toggle source
# File lib/functions_framework/server.rb, line 394
def initialize function, globals, config
  super config
  @function = function
  @globals = globals
end

Public Instance Methods

call(env) click to toggle source
# File lib/functions_framework/server.rb, line 400
def call env
  return notfound_response if excluded_path? env
  response =
    begin
      logger = env["rack.logger"] ||= @config.logger
      request = ::Rack::Request.new env
      logger.info "FunctionsFramework: Handling HTTP #{request.request_method} request"
      @function.call request, globals: @globals, logger: logger
    rescue ::StandardError => e
      e
    end
  interpret_response response
end