Skip to content

Commit

Permalink
Mount liteboard app on routes
Browse files Browse the repository at this point in the history
Unfortunately, the addition of litestack brings in dependencies on
hanami-router which is locked to rack 2.x. This means downgrading from
rack 3.x to rack 2.x—or otherwise fore-going the use of the liteboard
web interface.

For now, I've downgraded rack by making the dependency on 2.x explicit
in the Gemfile. I've also opened a new issue on hanami-router to track
progress toward Rack 3 support: hanami/router#268
  • Loading branch information
rossta committed Dec 31, 2023
1 parent d753056 commit 07d4eea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ gem "puma", ">= 5.0" # Use the Puma web server [https://github.com/puma/puma]
gem "sqlite3" # Use sqlite3 as the database for Active Record [https://github.com/sparklemotion/sqlite3-ruby]
gem "litestack" # All-in-one solution for SQLite data storage, caching, and background jobs [https://github.com/oldmoe/litestack]

gem "rack", "~> 2.2", ">= 2.2.7" # litestack's liteboard depends on hanami-router which does not currently support rack 3.x as of Dec 2023

# Asset management
gem "jsbundling-rails" # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]
gem "sprockets-rails" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
Expand Down
32 changes: 17 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ GEM
i18n (>= 1.8.11, < 2)
globalid (1.2.1)
activesupport (>= 6.1)
hanami-router (0.6.2)
hanami-utils (~> 0.7)
http_router (~> 0.11)
hanami-utils (0.9.2)
hanami-router (2.0.2)
mustermann (~> 3.0)
mustermann-contrib (~> 3.0)
rack (~> 2.0)
hansi (0.2.1)
hashdiff (1.0.1)
http_router (0.11.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
inline_svg (1.9.0)
Expand Down Expand Up @@ -192,6 +190,11 @@ GEM
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.7.2)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mustermann-contrib (3.0.0)
hansi (~> 0.2.0)
mustermann (= 3.0.0)
mutex_m (0.2.0)
net-imap (0.4.7)
date
Expand Down Expand Up @@ -219,18 +222,18 @@ GEM
puma (6.4.0)
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.8)
rack (2.2.8)
rack-mini-profiler (3.1.1)
rack (>= 1.2.0)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
rack (>= 3.0.0)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.2)
actioncable (= 7.1.2)
actionmailbox (= 7.1.2)
Expand Down Expand Up @@ -368,8 +371,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
url_mount (0.2.1)
rack
vite_rails (3.0.17)
railties (>= 5.1, < 8)
vite_ruby (~> 3.0, >= 3.2.2)
Expand Down Expand Up @@ -418,6 +419,7 @@ DEPENDENCIES
mail_interceptor
markdown-rails
puma (>= 5.0)
rack (~> 2.2, >= 2.2.7)
rack-mini-profiler
rails (~> 7.1)
rails_best_practices
Expand Down
4 changes: 4 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "litestack/liteboard/liteboard"

Rails.application.routes.draw do
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

Expand All @@ -6,6 +8,8 @@
# Defines the root path route ("/")
sitepress_root

mount Liteboard.app => "/liteboard"

# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
# Can be used by load balancers and uptime monitors to verify that the app is live.
get "up" => "rails/health#show", :as => :rails_health_check
Expand Down

0 comments on commit 07d4eea

Please sign in to comment.