Sha256: 03d1eec1f95de2ce1aaa6f1fb3055c29c2786fb757d9c44ff9fa305b8f40f529

Contents?: true

Size: 1.34 KB

Versions: 18

Compression:

Stored size: 1.34 KB

Contents

module Hanami
  class CLI
    module Commands
      # @since 1.1.0
      # @api private
      class Server < Command
        requires 'code_reloading'

        desc "Start Hanami server (only for development)"

        option :server,         desc: "Force a server engine (eg, webrick, puma, thin, etc..)"
        option :host,           desc: "The host address to bind to"
        option :port,           desc: "The port to run the server on", aliases: ["-p"]
        option :debug,          desc: "Turn on debug output"
        option :warn,           desc: "Turn on warnings"
        option :daemonize,      desc: "Daemonize the server"
        option :pid,            desc: "Path to write a pid file after daemonize"
        option :code_reloading, desc: "Code reloading", type: :boolean, default: true

        example [
          "                    # Basic usage (it uses the bundled server engine)",
          "--server=webrick    # Force `webrick` server engine",
          "--host=0.0.0.0      # Bind to a host",
          "--port=2306         # Bind to a port",
          "--no-code-reloading # Disable code reloading"
        ]

        # @since 1.1.0
        # @api private
        def call(*)
          require "hanami/server"
          Hanami::Server.new.start
        end
      end
    end

    register "server", Commands::Server, aliases: ["s"]
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hanami-1.3.5 lib/hanami/cli/commands/server.rb
hanami-1.3.4 lib/hanami/cli/commands/server.rb
hanami-1.3.3 lib/hanami/cli/commands/server.rb
hanami-1.3.2 lib/hanami/cli/commands/server.rb
hanami-1.3.1 lib/hanami/cli/commands/server.rb
hanami-1.3.0 lib/hanami/cli/commands/server.rb
hanami-1.3.0.beta1 lib/hanami/cli/commands/server.rb
hanami-1.2.0 lib/hanami/cli/commands/server.rb
hanami-1.2.0.rc2 lib/hanami/cli/commands/server.rb
hanami-1.2.0.rc1 lib/hanami/cli/commands/server.rb
hanami-1.2.0.beta2 lib/hanami/cli/commands/server.rb
hanami-1.2.0.beta1 lib/hanami/cli/commands/server.rb
hanami-1.1.1 lib/hanami/cli/commands/server.rb
hanami-1.1.0 lib/hanami/cli/commands/server.rb
hanami-1.1.0.rc1 lib/hanami/cli/commands/server.rb
hanami-1.1.0.beta3 lib/hanami/cli/commands/server.rb
hanami-1.1.0.beta2 lib/hanami/cli/commands/server.rb
hanami-1.1.0.beta1 lib/hanami/cli/commands/server.rb