From 79f408a155e90c7640500bc2d85d2a98bfa57ed5 Mon Sep 17 00:00:00 2001 From: icyleaf Date: Sat, 28 Apr 2018 17:40:25 +0800 Subject: [PATCH] feat: add marks in log to enabled basic auth --- src/hpr/api.cr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hpr/api.cr b/src/hpr/api.cr index b21224b..26e1ec6 100644 --- a/src/hpr/api.cr +++ b/src/hpr/api.cr @@ -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