I am still new to the Julia web stack – namely, the Genie and HTTP packages.
I know that it is possible to serve an HTML file with media type
text/html from, say, the root directory
route("/") do serve_static_file("index.html") end
Here are my questions:
How does Genie know which media type to serve the file with? Is it auto-detected from the file extension
.htmlor is it some other process?
Suppose I want to serve a file called
data.trigwith the media type
application/trigon the route
/data. Or, more generally, any HTTP response where I have modified the response headers and body to my liking. What is the proper way to go about this?
(I am still new to the Julia web stack, so any resources on how to modify response headers in Genie.jl or HTTP.jl would be welcome also.)
Thanks in advance!