inferno_core 0.4.1.pre → 0.4.1

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: 6298621895590280c4be9dc0d0d50849309001c3656a8a37563cfb9b0d1d66df
4
+ data.tar.gz: e00862f7d7f03b24d4d8b7aa8ca21271859e9a5e8881398375e2232e2265e677
5
5
  SHA512:
6
- metadata.gz: 69386d4f27400b9252f347fddaa6022040e93e39ca6a0f1546b6d1f5c98100a6a088eaa643f59158aa28fd168d0a166c75247dacb88843a2c62a83ebaea52bfc
7
- data.tar.gz: f76efc33a466b380ad0d83b9d39c13950d07057b1ac2c3a59e6bf07dc73f138e17c13b642d521318a7c26ab81151a9ccd3b8652cb9047101107e535f86243ef1
6
+ metadata.gz: be75450df30000af28f639c5605cfa8221f760eefd33f3d82e38a65f2fcd2e3b69480b6634880b3733115553ec2d0f6f914e21c01f1eefb400cd28ba29111793
7
+ data.tar.gz: f7946b9236acce460f47388805a7cfbab03c9f7bed6b38e0ac25b86ce664e369e3121ede1b83989db4c1073fe1402c0ca98e7ce5eba30cdc9a3052647fed5edf
@@ -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