inferno_core 0.4.1.pre → 0.4.1.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39b389739b83d64f5704f2c512888d6e03028202e015c7461cb4aa3df0a1ea82
4
- data.tar.gz: 569bbcd9d0bb00bc79605d46db856a3bd48257f058bf15f63cd954a211f3947f
3
+ metadata.gz: 0aa38790217e6f50f65813af1eb2f4eb166b0fdcb1072c4abb722ba1348d852a
4
+ data.tar.gz: 5ecc8a350a4f2d036c099d18b477abc4e77d2ae90f8d90801cb14c9f49dc6f49
5
5
  SHA512:
6
- metadata.gz: 69386d4f27400b9252f347fddaa6022040e93e39ca6a0f1546b6d1f5c98100a6a088eaa643f59158aa28fd168d0a166c75247dacb88843a2c62a83ebaea52bfc
7
- data.tar.gz: f76efc33a466b380ad0d83b9d39c13950d07057b1ac2c3a59e6bf07dc73f138e17c13b642d521318a7c26ab81151a9ccd3b8652cb9047101107e535f86243ef1
6
+ metadata.gz: f82cb94c8a774d9ffc5fe1ae275adabc5af1aa8b784473bad100708350b48d04b371e6b26e61a4d195a36b1729285ec286da68b38b01baa1c60604e57fba1d2e
7
+ data.tar.gz: db8ce967f8bea92d0f357f989d862ca78c8922367f9c7bdec0cf9611fe473da9d1cf89341f96e837783f74b00b9842bfa7a625206436c649e3197aacfe061d14
@@ -7,8 +7,7 @@ module Inferno
7
7
  client_page = ERB.new(File.read(File.join(Inferno::Application.root, 'lib', 'inferno', 'apps', 'web',
8
8
  'index.html.erb'))).result
9
9
 
10
- base_path = Application['base_path']
11
- base_path = "/#{base_path.delete_prefix('/')}" if base_path.present?
10
+ base_path = Application['base_path']&.delete_prefix('/')
12
11
 
13
12
  route_block = proc do
14
13
  scope 'api' do
@@ -73,9 +72,14 @@ module Inferno
73
72
  end
74
73
  end
75
74
 
76
- Router =
75
+ Router = # rubocop:disable Naming/ConstantName
77
76
  if base_path.present?
78
- Hanami::Router.new(prefix: base_path, &route_block)
77
+ Hanami::Router.new do
78
+ scope("#{base_path}/") do
79
+ get '/', to: ->(_env) { [200, { 'Content-Type' => 'text/html' }, [client_page]] }
80
+ end
81
+ scope(base_path, &route_block)
82
+ end
79
83
  else
80
84
  Hanami::Router.new(&route_block)
81
85
  end