Closed califrench closed 8 years ago
This issue isn't as simple as writing an else statement and returning a different response since responses must have a body of the following type: String?
I'm trying to figure out a solution for this but most likely won't come up with the most graceful one. I'll submit a PR if I think my solution is viable.
@califrench thanks. I believe there is solution for mime types management in Swift, we should not be very first facing this issue :) Please let me know if you will find something.
@sauliusgrigaitis I realized that this was highlighting two different issues as I typed my explanation up.
One issue is the fact we are sending all assets with text/plain
but the bigger issue is we can only return text resources and not binary files with a Response
This is no longer an issue. EDIT: I forgot this was referring to files such as images. It is still an issue.
This is a duplicate of #28
I'm trying to load images from the public directory but it seems from looking at the router code that anything loaded from the public directory needs to be source code—like css or js files.
We should be able to also load images and other assets from that directory. Also CSS files and JS files should return a different mimetype than
text/plain
.