summaryrefslogtreecommitdiff
path: root/new/lib/crys/server.rb
blob: aa0c19c3825b45093047192b79c7538591fae6c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'webrick'  
module Crys
  class Server
    def initialize(root:)
      @root = root
    end

    def start
      server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root
      trap 'INT' do server.shutdown end

      server.start
    end

      private

      attr_reader :root

  end
end