Class: HTTPMe::Command
- Inherits:
-
MisterBin::Command
- Object
- MisterBin::Command
- HTTPMe::Command
- Includes:
- Colsole
- Defined in:
- lib/httpme/command.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/httpme/command.rb', line 31 def run path = args['PATH'] || ENV['HTTPME_PATH'] || '.' port = (args['--port'] || ENV['HTTPME_PORT'] || 3000).to_i host = args['--host'] || ENV['HTTPME_HOST'] || '0.0.0.0' auth = args['--auth'] || ENV['HTTPME_AUTH'] raise ArgumentError, "Path not found [#{path}]" unless Dir.exist? path Server.setup path: path, host: host, port: port, auth: auth Server.run! end |