summaryrefslogtreecommitdiff
path: root/new/lib/crys/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'new/lib/crys/server.rb')
-rw-r--r--new/lib/crys/server.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/new/lib/crys/server.rb b/new/lib/crys/server.rb
new file mode 100644
index 0000000..aa0c19c
--- /dev/null
+++ b/new/lib/crys/server.rb
@@ -0,0 +1,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
+