Sha256: 881c0f05e1c61f24d36092e41175e8835ecb75b2ba943d9f4f9ce76dc27f773e
Contents?: true
Size: 709 Bytes
Versions: 1
Compression:
Stored size: 709 Bytes
Contents
require 'ptools' require_relative 'daftos/server.rb' require_relative 'apis/filesystem_api.rb' require_relative 'apis/apps_api.rb' class Daftos def self.start() fork do Dir.chdir(Dir.home) Dir.mkdir('.daftos') unless Dir.exist?('.daftos') File.open('.daftos/server.pid', 'w') {|f| f.write Process.pid } builder = Rack::Builder.new do map('/api/file_system'){ run FileSystemAPI } map('/api/apps'){ run AppsAPI } map('/'){ run Server } end Rack::Handler::Thin.run builder, :Port => 9999 end end def self.stop Dir.chdir(Dir.home) Process.kill 'TERM', File.read('.daftos/server.pid').to_i end end Daftos.start()
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
daftos-0.3.0 | lib/daftos.rb |