mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Add built-in exception route
This commit is contained in:
parent
58013ba005
commit
e1530f8fd5
3 changed files with 10 additions and 2 deletions
|
@ -29,5 +29,13 @@ at_exit do
|
|||
exit
|
||||
}
|
||||
|
||||
# This route serves the built-in images for not_found and exceptions.
|
||||
get "/__kemal__/:image" do |env|
|
||||
image = env.params["image"]
|
||||
file_path = File.expand_path("libs/kemal/images/#{image}", Dir.working_directory)
|
||||
env.add_header "Content-Type", "application/octet-stream"
|
||||
File.read(file_path)
|
||||
end
|
||||
|
||||
server.listen
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue