Arc Forumnew | comments | leaders | submitlogin
2 points by absz 6044 days ago | link | parent

I've had plenty of luck using the Anarki (the git wiki); it has support for specifying a root "static files" directory, and maps files in there to MIME types by extension. In other words, to set the root directory to "/home/croach/site/", run

  (= rootdir* "/home/croach/site/")
Now, if you have the file "/home/croach/site/js/script.js", then going to "http://localhost:8080/js/script.js" will serve the Javascript. Mimetypes are stored in the table ext-mimetypes* , and can be accessed and added to as expected. For instance,

  arc> (ext-mimetypes* "js")
  "text/javascript; charset=utf-8"
  arc> (ext-mimetypes* "svg")
  nil
  arc> (= (ext-mimetypes* "svg") "image/svg+xml; charset=utf-8")
  "image/svg+xml; charset=utf-8"
Now, all your SVG files with extension ".svg" will be served with the proper MIME type and headers. I hope that helps with your problem!


1 point by croach 6044 days ago | link

Thanks absz, I'll take a look into the Anarki solution as soon as my work day comes to an end. Thanks for the response.

-----