@@ -0,0 +1,975 @@
+package com.skogsrud.halvard.sparkjava.spike;%0A%0Aimport javax.imageio.ImageIO;%0Aimport javax.servlet.ServletOutputStream;%0Aimport java.awt.*;%0Aimport java.awt.image.BufferedImage;%0A%0Aimport static spark.Spark.*;%0A%0Apublic class Image %7B%0A    public static void main(String%5B%5D args) %7B%0A        get(%22/image%22, (request, response) -%3E %7B%0A            response.status(200);%0A            response.type(%22image/jpeg%22);%0A%0A            BufferedImage image = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB);%0A            Graphics2D graphics = image.createGraphics();%0A            graphics.setColor(Color.WHITE);%0A            graphics.fillOval(64, 64, 128, 128);%0A            try (ServletOutputStream out = response.raw().getOutputStream()) %7B%0A                ImageIO.write(image, %22JPEG%22, out);%0A            %7D%0A            return response.raw();%0A        %7D);%0A%0A         before((request, response) -%3E %7B%0A            response.header(%22cache-control%22, %22no-cache, no-store, must-revalidate%22);%0A        %7D);%0A    %7D%0A%7D%0A

Add endpoint for returning image as JPEG