All paths (URLs) with corresponding HTTP verbs and other related restrictions must be declared in config/routes.rb.
MyApp::Application.routes.draw do
get 'my-service' => 'service#index'
post 'my-service' => 'service#update'
end
Once the routes are defined, Rails will respond to the corresponding verb / path argument as you specified - usually by loading the controller and starting the specified action.
class ServiceController < ApplicationController
def index
end
def update
end
end