add "api"

This commit is contained in:
Hexaitos 2024-11-10 18:13:42 +01:00
parent 61f0903c19
commit 4642dbf0d4
1 changed files with 6 additions and 0 deletions

View File

@ -16,3 +16,9 @@ end
get '/about' do get '/about' do
erb :about erb :about
end end
get '/api/random' do
content_type :json
image = get_random_image(get_images_by_category(categories))
image.to_json
end