PORT -> CREDGER_PORT

This commit is contained in:
Gwenhael Le Moine 2021-05-12 16:58:10 +02:00
parent 4357ac5002
commit d3ff3891c8
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -5,12 +5,10 @@ require "./ledger"
ENV["CREDGER_CURRENCY"] ||= "" ENV["CREDGER_CURRENCY"] ||= ""
ENV["CREDGER_SEPARATOR"] ||= "," ENV["CREDGER_SEPARATOR"] ||= ","
ENV["PORT"] ||= "3000" ENV["CREDGER_PORT"] ||= "3000"
WD = File.dirname( Process.executable_path.to_s ) WD = File.dirname( Process.executable_path.to_s )
ledger = Ledger.new
public_folder( "#{WD}/public" ) public_folder( "#{WD}/public" )
# Matches GET "http://host:port/" # Matches GET "http://host:port/"
@ -20,6 +18,8 @@ get "/" do |env|
send_file( env, "#{WD}/public/index.html" ) send_file( env, "#{WD}/public/index.html" )
end end
ledger = Ledger.new
get "/api/ledger/version" do |env| get "/api/ledger/version" do |env|
env.response.content_type = "text" env.response.content_type = "text"
@ -59,4 +59,4 @@ get "/api/ledger/register" do |env|
.to_json .to_json
end end
Kemal.run( ENV["PORT"].to_i ) Kemal.run( ENV["CREDGER_PORT"].to_i )