Class: Puffs::ServerConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/server_connection.rb

Overview

Invoked through ‘puffs server` in CLI.

Class Method Summary collapse

Class Method Details

.startObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/server_connection.rb', line 7

def self.start
  app = proc do |env|
    req = Rack::Request.new(env)
    res = Rack::Response.new
    ROUTER.run(req, res)
    res.finish
  end

  Rack::Server.start(
    app: app,
    Port: 3000
  )
end