Ions: respond with file

I’m serving a ring app via an ionized handler. One thing that I’ve only just got working was the serving of static assets. I jumped to the (wrong) conclusion that the files were not included in the deployed bundle. It turns out the issue was the ring response map had a java.io.File instead of a string as the :body. If I (update response :body slurp) all is well.

My question is, is there any way to return a file, or some other stream-like thing, to the next layer up in the stack? I feel like I don’t want to be reading potentially large files fully into memory like that. Maybe the same thing would just happen somewhere else so it’s not really a problem.

Tom

Hi Tom,

You should be able to return an InputStream, per the docs.

Cheers,
Stu