Class: Pakyow::Processes::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/pakyow/processes/server.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint:, protocol:, scheme:) ⇒ Server

Returns a new instance of Server.



21
22
23
# File 'lib/pakyow/processes/server.rb', line 21

def initialize(endpoint:, protocol:, scheme:)
  @endpoint, @protocol, @scheme = endpoint, protocol, scheme
end

Class Method Details

.running_text(scheme:, host:, port:) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pakyow/processes/server.rb', line 11

def running_text(scheme:, host:, port:)
  text = String.new("Pakyow › #{Pakyow.env.capitalize}")
  text << "#{scheme}://#{host}:#{port}"

  Support::CLI.style.blue.bold(
    text
  ) + Support::CLI.style.italic("\nUse Ctrl-C to shut down the environment.")
end

Instance Method Details

#runObject



25
26
27
28
29
# File 'lib/pakyow/processes/server.rb', line 25

def run
  Async::HTTP::Server.new(
    Pakyow.boot, @endpoint, @protocol, @scheme
  ).run
end