Add /status/:code
All checks were successful
Gitea Actions Demo / lint (push) Successful in 1m24s
Gitea Actions Demo / test (push) Successful in 1m21s
Gitea Actions Demo / release-image (push) Successful in 1m3s

This commit is contained in:
Ryan Cavicchioni 2024-08-11 16:43:23 -05:00
parent 72f083c444
commit faabee2f8c
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 7 additions and 0 deletions

6
app.rb
View File

@ -2,6 +2,7 @@ require "bundler/setup"
require "sinatra"
require "sinatra/json"
require "sinatra/cookies"
require "sinatra/multi_route"
require "time"
require "fileutils"
require "json"
@ -355,3 +356,8 @@ get "/_cat/cookies" do
end
end
end
route :delete, :get, :patch, :post, :put, "/status/:code" do
code = params[:code]
status if code.between? 100, 599
end

View File

@ -28,6 +28,7 @@ spec:
containers:
- name: toy
image: git.kill0.net/ryanc/toy:latest
imagePullPolicy: Always
ports:
- name: web
containerPort: 4567