Skip to content

Commit 1e6210d

Browse files
committed
[rage] Implement pipeline in routes
Rage allows routing to Rack directly for simple responses: https://api.rage-rb.dev/Rage/Router/DSL/Handler#get-instance_method
1 parent 00946aa commit 1e6210d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

frameworks/rage/app/controllers/benchmark_controller.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ def self.dataset_items = @dataset_items
3131
headers["server"] = SERVER_NAME
3232
end
3333

34-
def pipeline
35-
render plain: 'ok'
36-
end
37-
3834
def baseline_one
3935
total = params[:a].to_i + params[:b].to_i
4036
if request.post?

frameworks/rage/config/routes.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Rage.routes.draw do
2-
get '/pipeline', to: 'benchmark#pipeline'
2+
get '/pipeline', to: ->(env) do
3+
[200, {
4+
'content-type' => 'text/plain'
5+
}, ['ok']]
6+
end
37
get '/baseline11', to: 'benchmark#baseline_one'
48
post '/baseline11', to: 'benchmark#baseline_one'
59
get '/baseline2', to: 'benchmark#baseline_two'

0 commit comments

Comments
 (0)