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 +4 -4
- data/lib/inferno/apps/web/router.rb +8 -4
- data/lib/inferno/public/bundle.js +2 -2
- data/lib/inferno/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6298621895590280c4be9dc0d0d50849309001c3656a8a37563cfb9b0d1d66df
|
4
|
+
data.tar.gz: e00862f7d7f03b24d4d8b7aa8ca21271859e9a5e8881398375e2232e2265e677
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|