Skip to content

Commit

Permalink
Added support for enviroments and logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Dec 7, 2018
1 parent 53f30ba commit 46d9787
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SOUNDECK_BASE_URL="https://soundeck.fm"
SOUNDECK_SESSIONS_SECRET="29a948460c00c7be98802959429d395b4605c3f99188fb22b5cd7e355b75e409c64de8a88957325d4fffcfb8706c3418fdd472c843459692fc4fdb954873c57e"
ADMIN_SESSIONS_SECRET="dc7cfa459fb7daa11241b8c1841a6dedc53fa89bd18469fb337ddab8fb71d0ce21b75b78ad19a24a91b3dc43705de9818092e3bd2b3fa12683aa31b3cc27a7d7"
9 changes: 5 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ GIT

GIT
remote: https://github.com/hanami/hanami.git
revision: 7de723470f93cadfdf59de4b039d1ff628bd04a4
revision: 932b4c3af193e121c5aca9dc69ef15282ed2a95a
branch: feature/application
specs:
hanami (2.0.0.alpha1)
bundler (~> 1.16)
dry-inflector (~> 0.1, >= 0.1.2)
dry-system (~> 0.10)
hanami-cli (~> 1.0.alpha)
hanami-controller (~> 2.0.alpha)
Expand Down Expand Up @@ -56,7 +57,7 @@ GEM
byebug (10.0.2)
concurrent-ruby (1.1.3)
dotenv (2.5.0)
dry-auto_inject (0.5.0)
dry-auto_inject (0.6.0)
dry-container (>= 0.3.4)
dry-configurable (0.7.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -85,7 +86,7 @@ GEM
dry-equalizer (~> 0.2)
dry-inflector (~> 0.1, >= 0.1.2)
dry-struct (~> 0.5)
dry-types (0.13.2)
dry-types (0.13.3)
concurrent-ruby (~> 1.0)
dry-container (~> 0.3)
dry-core (~> 0.4, >= 0.4.4)
Expand All @@ -100,7 +101,7 @@ GEM
mustermann (= 1.0.3)
puma (3.12.0)
rack (2.0.6)
transproc (1.0.2)
transproc (1.0.3)

PLATFORMS
ruby
Expand Down
3 changes: 0 additions & 3 deletions apps/admin/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

module Admin
class Action < Hanami::Action
# config.cookies = { max_age: 300 }
# config.sessions = :cookie, { secret: ENV["ADMIN_SESSIONS_SECRET"] }

include Actions::Authentication
end
end
1 change: 1 addition & 0 deletions apps/web/actions/home/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Index < Web::Action
include Authentication::Skip

def call(*, res)
Hanami.logger.debug("home")
res.body = "OK"
end
end
Expand Down
5 changes: 5 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ class Application < Hanami::Application
config.cookies = { max_age: 600 }
config.sessions = :cookie, { secret: ENV["SOUNDECK_SESSIONS_SECRET"] }
config.middleware.use Middleware::Elapsed, "1.0"

config.environment(:production) do |c|
c.base_url = ENV["SOUNDECK_BASE_URL"]
c.logger = { level: :info, formatter: :json }
end
end
end

0 comments on commit 46d9787

Please sign in to comment.