Fork me on GitHub

Hello, could someone give me an example, how I could serve images with liberator? In my case I want to build an string from db entries which results in an image location. This imagefile should be returned as file response.


@danielgrosse they key is that return a status code that redirects, i.e. 303 or 307. In the decision that triggers this status code set the context key :location to the URL you want to redirect to.


For the resource that serves the actual image you need to specify the correct available content-types, e.g. image/png and the handler, say, :handle-ok can return a or a byte stream.


Thank you for the answer.


feel free to ask when you’re stuck somehow. May I ask why you want to do the redirect?