Class: Nopoint::Commands::Serve

Inherits:
Nopoint::Command show all
Defined in:
lib/nopoint/commands/serve.rb

Class Method Summary collapse

Class Method Details

.process(options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/nopoint/commands/serve.rb', line 4

def self.process(options = {})
	require 'webrick'

	root = File.expand_path('public', Dir.pwd)
	server = WEBrick::HTTPServer.new(
		:Port => 2337,
		:DocumentRoot => root
	)

	trap('INT') { server.shutdown }
	server.start
end