Add /status/:code
This commit is contained in:
parent
72f083c444
commit
f10d8fa8d5
6
app.rb
6
app.rb
@ -2,6 +2,7 @@ require "bundler/setup"
|
|||||||
require "sinatra"
|
require "sinatra"
|
||||||
require "sinatra/json"
|
require "sinatra/json"
|
||||||
require "sinatra/cookies"
|
require "sinatra/cookies"
|
||||||
|
require "sinatra/multi_route"
|
||||||
require "time"
|
require "time"
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
require "json"
|
require "json"
|
||||||
@ -355,3 +356,8 @@ get "/_cat/cookies" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
route :delete, :get, :patch, :post, :put, "/status/:code" do
|
||||||
|
code = params[:code]
|
||||||
|
status code.between? 100, 599
|
||||||
|
end
|
||||||
|
@ -28,6 +28,7 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: toy
|
- name: toy
|
||||||
image: git.kill0.net/ryanc/toy:latest
|
image: git.kill0.net/ryanc/toy:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- name: web
|
- name: web
|
||||||
containerPort: 4567
|
containerPort: 4567
|
||||||
|
Loading…
Reference in New Issue
Block a user