Class: Padrino::Server

### Home Classes Methods

### In Files

- lib/padrino-core/server.rb

### Parent

Rack::Server

### Methods

- ::new
- ::start
- #app
- #options
- #start
- #wrapped_app

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetup
- Padrino::ApplicationSetup::ClassMethods
- Padrino::AuthenticityToken
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Cli::Launcher
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Loader
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::ApplicationWrapper
- Padrino::Mounter::MounterException
- Padrino::ParamsProtection
- Padrino::ParamsProtection::ClassMethods
- Padrino::ParamsProtection::InstanceMethods
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Reloader::Storage
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::FreeRegex
- HttpRouter::Node::Glob
- HttpRouter::Node::Path
- HttpRouter::Node::SpanningRegex
- HttpRouter::Request
- HttpRouter::Route
- Sinatra
- Sinatra::Base
- Sinatra::Request
- Kernel
- Object
- PadrinoTasks

No matching classes.

# Padrino::Server

This module builds a Padrino server to run the project based on available handlers.

### Constants

DEFAULT_ADDRESS
Handlers

  Server Handlers

### Public Class Methods

new(options, app) click to toggle source

    # File lib/padrino-core/server.rb, line 52
    def initialize(options, app)
      @options, @app = options, app
    end

start(app, options={}) click to toggle source

Starts the application on the available server with specified options.

    # File lib/padrino-core/server.rb, line 41
    def self.start(app, options={})
      options = options.to_hash.symbolize_keys
      options.update(parse_server_options(options.delete(:options)))
      options.update(detect_address(options))
      options[:pid] = prepare_pid(options[:pid]) if options[:daemonize]
      options[:server] = detect_rack_handler if options[:server].blank?
      # disable Webrick AccessLog
      options[:AccessLog] = []
      new(options, app).start
    end

### Public Instance Methods

app() click to toggle source

The application the server will run.

    # File lib/padrino-core/server.rb, line 68
    def app
      @app
    end

Also aliased as: wrapped_app
options() click to toggle source

    # File lib/padrino-core/server.rb, line 73
    def options
      @options
    end

start() click to toggle source

Starts the application on the available server with specified options.

    # File lib/padrino-core/server.rb, line 57
    def start
      puts "=> Padrino/#{Padrino.version} has taken the stage #{Padrino.env} at http://#{options[:Host]}:#{options[:Port]}"
      [:INT, :TERM].each { |sig| trap(sig) { exit } }
      super do |server|
        server.threaded = true if server.respond_to?(:threaded=)
      end
    ensure
      puts "<= Padrino leaves the gun, takes the cannoli" unless options[:daemonize]
    end

wrapped_app() click to toggle source
Alias for: app

[Validate]

Generated with the Darkfish Rdoc Generator 2.