2

The Ruby library, Sprockets, allows you to set up an environment consisting of one or more load paths, and then can serve static files under those paths over HTTP.

It also will do ETags and preprocessing (for example, if you want to use CoffeeScript or Sass)

Has anyone written something like this in Haskell? (preferably using Wai?)

5
  • 1
    I don't have experience with sprockets, but wai-app-static and servius each perform functionality somewhat similar to what you're describing. Is that the kind of thing you're looking for? Dec 25, 2013 at 14:17
  • wai-app-static does almost everything I'm after, thanks :)
    – hdgarrood
    Dec 25, 2013 at 14:36
  • The only thing that's missing is arbitrary preprocessors. If I could tell a wai-app-static application that, for example, to make a CSS file, it should take the corresponding SCSS file and run "sass" on it, that would be perfect. I suppose I'd need to write that myself? Does that fall within the scope of wai-app-static or would it have to be a separate package?
    – hdgarrood
    Dec 25, 2013 at 14:39
  • 1
    That kind of a job might be even better suited to a WAI middleware, which would intercept a ResponseFile with a given file extension and preprocess the file. Dec 25, 2013 at 17:47
  • ah, of course -- thanks :) That answers everything. If you make your comments into an answer, I'll accept it.
    – hdgarrood
    Dec 26, 2013 at 0:23

1 Answer 1

1

wai-app-static provides a WAI application for serving static files. This could be combined with a WAI middleware to preprocess ResponseFile constructors with certain file extension to deliver the desired functionality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.