Created routes
This commit is contained in:
parent
64413a8131
commit
07d3ad1329
26
app/controllers/metrics_controller.rb
Normal file
26
app/controllers/metrics_controller.rb
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
class MetricsController < ActionController::API
|
||||||
|
|
||||||
|
# GET /metric
|
||||||
|
def index
|
||||||
|
render json: {}
|
||||||
|
end
|
||||||
|
|
||||||
|
# POST /metric/:key
|
||||||
|
def create
|
||||||
|
key = params[:key]
|
||||||
|
render json: {}
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /metric/:key
|
||||||
|
def show
|
||||||
|
# Return an empty JSON response
|
||||||
|
render json: {}
|
||||||
|
end
|
||||||
|
|
||||||
|
# DELETE /metric/:key
|
||||||
|
def delete
|
||||||
|
key = params[:key]
|
||||||
|
render json: {}
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@ -1,6 +1,9 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
||||||
|
get '/metric/', to: 'metrics#index'
|
||||||
|
post '/metric/:key', to: 'metrics#create'
|
||||||
|
get '/metric/:key', to: 'metrics#show'
|
||||||
|
delete '/metric/:key', to: 'metrics#delete'
|
||||||
# Defines the root path route ("/")
|
# Defines the root path route ("/")
|
||||||
# root "articles#index"
|
# root "articles#index"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user