Class: Florby::Server

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject



5
6
7
# File 'lib/florby/server.rb', line 5

def self.run
  new.run
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/florby/server.rb', line 9

def run
  server = WEBrick::HTTPServer.new(
    DocumentRoot: File.join(Dir.pwd, '_build'),
    Port: 8081,
  )

  trap(:INT) do
    server.shutdown
  end

  server.start
end