可用的 Sinatra 路由動詞
Sinatra 中有許多可用的路由動詞,它們直接對應於 http 動詞
get '/' do
.. get some data, a view, json, etc ..
end
post '/' do
.. create a resource ..
end
put '/' do
.. replace a resource ..
end
patch '/' do
.. change a resource ..
end
delete '/' do
.. delete something ..
end
options '/' do
.. appease something ..
end
link '/' do
.. affiliate something ..
end
unlink '/' do
.. separate something ..
end