Class: Ordserve

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/ordserve.rb,
lib/ordserve/service.rb

Overview

todo/check: find a better name?

Class Method Summary collapse

Class Method Details

.main(argv = ARGV) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ordserve.rb', line 17

def self.main( argv=ARGV )
   puts 'hello from main with args:'
   pp argv

   path = argv[0] || './content'

   puts "  using content_folder: >#{path}<"

   ## note: let's you use  latter settings.content_folder (resulting in path)
   set( :content_folder, File.expand_path(path))

#####
# fix/todo:
##   use differnt port ??
##
##  use --local  for host e.g. 127.0.0.1  insteaod of 0.0.0.0 ???

 #   puts 'before Puma.run app'
 #   require 'rack/handler/puma'
 #   Rack::Handler::Puma.run ProfilepicService, :Port => 3000, :Host => '0.0.0.0'
 #   puts 'after Puma.run app'

 # use webrick for now - why? why not?
   puts 'before WEBrick.run service'
   Rack::Handler::WEBrick.run Ordserve, :Port => 3000, :Host => '127.0.0.1'
   puts 'after WEBrick.run service'

  puts 'bye'
end