Skip to content

Commit eba3800

Browse files
committed
[rails] Implement pipeline in routes
Rails allows routing to Rack directly for simple responses: https://guides.rubyonrails.org/routing.html#routing-to-rack-applications
1 parent 00946aa commit eba3800

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

frameworks/rails/app/controllers/benchmark_controller.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ class BenchmarkController < ActionController::API
1818

1919
PG_QUERY = 'SELECT id, name, category, price, quantity, active, tags, rating_score, rating_count FROM items WHERE price BETWEEN $1 AND $2 LIMIT $3'.freeze
2020

21-
def pipeline
22-
render plain: 'ok'
23-
end
24-
2521
def baseline11
2622
total = params[:a].to_i + params[:b].to_i
2723
if request.post?

frameworks/rails/config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Rails.application.routes.draw do
2-
get '/pipeline', to: 'benchmark#pipeline'
2+
get '/pipeline', to: ->(env) { [204, {}, ['ok']] }
33
get '/baseline11', to: 'benchmark#baseline11'
44
post '/baseline11', to: 'benchmark#baseline11'
55
get '/baseline2', to: 'benchmark#baseline2'

0 commit comments

Comments
 (0)