Sha256: 618ce3bd239df6c6c6c79151e0c578e5ba2b704d21dd42d98e6f73a9ad68462f

Contents?: true

Size: 476 Bytes

Versions: 3

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

require 'rack'

require 'mwc/utils/command'
require 'mwc/server'
require 'mwc'

module Mwc
  module Commands
    # :nodoc:
    class Server < Thor::Group
      include Utils::Command

      name 'server'
      description 'serve compiled wasm'
      add_option :port, type: :numeric, default: 8080

      def boot
        Rack::Handler
          .default
          .run(Mwc::Server.new, Port: parent_options['port'])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mwc-0.4.0 lib/mwc/commands/server.rb
mwc-0.3.0 lib/mwc/commands/server.rb
mwc-0.2.0 lib/mwc/commands/server.rb