Skip to content

Commit

Permalink
feat: add marks in log to enabled basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Apr 28, 2018
1 parent 08a9c48 commit 79f408a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hpr/api.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ module Hpr::API
CLIENT = Client.new

def self.run(port = 8848)
Hpr.logger.info "API Server now listening at localhost:#{port}, press Ctrl-C to stop"

if Hpr.config.basic_auth.enable
enable_auth = Hpr.config.basic_auth.enable
if enable_auth
basic_auth Hpr.config.basic_auth.user, Hpr.config.basic_auth.password
end

Hpr.logger.info "API Server now listening at localhost:#{port}#{enable_auth ? " (basic auth)" : ""}, press Ctrl-C to stop"

Kemal.run(port) do |config|
config.env = "production"
end
Expand Down

0 comments on commit 79f408a

Please sign in to comment.