From 4642dbf0d43e4fc5b97c15b6d1c9176a6eff347a Mon Sep 17 00:00:00 2001 From: Hexaitos Date: Sun, 10 Nov 2024 18:13:42 +0100 Subject: [PATCH] add "api" --- server.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.rb b/server.rb index 974de20..f739d4d 100644 --- a/server.rb +++ b/server.rb @@ -15,4 +15,10 @@ end get '/about' do erb :about +end + +get '/api/random' do + content_type :json + image = get_random_image(get_images_by_category(categories)) + image.to_json end \ No newline at end of file