inferno_core 0.4.0 → 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: 987a2db725cb3b2517f392d2e566614f3e5fcd454f27164e6de64ec615b5661c
4
- data.tar.gz: 1cce12a803e20d288e72f9f3b1dfd1def94f9cbe1fcb73f4c862f1063c3d5c8c
3
+ metadata.gz: 0aa38790217e6f50f65813af1eb2f4eb166b0fdcb1072c4abb722ba1348d852a
4
+ data.tar.gz: 5ecc8a350a4f2d036c099d18b477abc4e77d2ae90f8d90801cb14c9f49dc6f49
5
5
  SHA512:
6
- metadata.gz: 646f385e975efc9eb957aa707934e7c3e04977c97bd73dae4a21a8dbfd60869c1662f1832bfac1a38cb534ed18ebc93d771937a8978a7fb5dba7e0b3db54b974
7
- data.tar.gz: 106dc72ddaaba5f02be715aef376984adb7c97ae71c62668d45da094bcfe430ee1a7c5d940c99e92bfc645bc31c8bb2013406aaffb2a072fc1d0fc9771a3187f
6
+ metadata.gz: f82cb94c8a774d9ffc5fe1ae275adabc5af1aa8b784473bad100708350b48d04b371e6b26e61a4d195a36b1729285ec286da68b38b01baa1c60604e57fba1d2e
7
+ data.tar.gz: db8ce967f8bea92d0f357f989d862ca78c8922367f9c7bdec0cf9611fe473da9d1cf89341f96e837783f74b00b9842bfa7a625206436c649e3197aacfe061d14
@@ -7,10 +7,9 @@ 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
- Router = Hanami::Router.new(prefix: base_path) do
12
+ route_block = proc do
14
13
  scope 'api' do
15
14
  scope 'test_runs' do
16
15
  post '/', to: Inferno::Web::Controllers::TestRuns::Create, as: :create
@@ -72,5 +71,17 @@ module Inferno
72
71
  get suite_path, to: ->(_env) { [200, {}, [client_page]] }
73
72
  end
74
73
  end
74
+
75
+ Router = # rubocop:disable Naming/ConstantName
76
+ if base_path.present?
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
83
+ else
84
+ Hanami::Router.new(&route_block)
85
+ end
75
86
  end
76
87
  end
@@ -8,5 +8,8 @@ Inferno::Application.boot(:web) do |_app|
8
8
  Blueprinter.configure do |config|
9
9
  config.generator = Oj
10
10
  end
11
+
12
+ require 'inferno/utils/middleware/request_logger'
13
+ require 'inferno/apps/web/application'
11
14
  end
12
15
  end