can launch binary from anywhere

This commit is contained in:
Gwenhael Le Moine 2017-11-24 15:32:19 +01:00
parent 8b40bc6db3
commit b74c36365c
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -7,13 +7,17 @@ SEPARATOR = ","
ENV["PORT"] ||= "3000"
WD = File.dirname( Process.executable_path.to_s )
ledger = Ledger.new
public_folder( "#{WD}/public" )
# Matches GET "http://host:port/"
get "/" do |env|
env.response.content_type = "text/html"
send_file( env, "./public/index.html" )
send_file( env, "#{WD}/public/index.html" )
end
get "/api/ledger/version" do |env|