From d3ff3891c8e42284ce145fd51c19404da6eb223b Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 12 May 2021 16:58:10 +0200 Subject: [PATCH] PORT -> CREDGER_PORT --- credger.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/credger.cr b/credger.cr index d3f2185..848895e 100644 --- a/credger.cr +++ b/credger.cr @@ -5,12 +5,10 @@ require "./ledger" ENV["CREDGER_CURRENCY"] ||= "€" ENV["CREDGER_SEPARATOR"] ||= "," -ENV["PORT"] ||= "3000" +ENV["CREDGER_PORT"] ||= "3000" WD = File.dirname( Process.executable_path.to_s ) -ledger = Ledger.new - public_folder( "#{WD}/public" ) # Matches GET "http://host:port/" @@ -20,6 +18,8 @@ get "/" do |env| send_file( env, "#{WD}/public/index.html" ) end +ledger = Ledger.new + get "/api/ledger/version" do |env| env.response.content_type = "text" @@ -59,4 +59,4 @@ get "/api/ledger/register" do |env| .to_json end -Kemal.run( ENV["PORT"].to_i ) +Kemal.run( ENV["CREDGER_PORT"].to_i )