0.2.3 permalink Arrow_down_16x16

file-response

ring.util.response

  • (file-response filepath & [opts])
Returns a Ring response to serve a static file, or nil if an appropriate
file does not exist.
Options:
:root - take the filepath relative to this root path
:index-files? - look for index.* files in directories, defaults to true

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source ring/util/response.clj:47 top

(defn file-response
  "Returns a Ring response to serve a static file, or nil if an appropriate
  file does not exist.
  Options:
    :root         - take the filepath relative to this root path
    :index-files? - look for index.* files in directories, defaults to true"
  [filepath & [opts]]
  (if-let [file (get-file filepath opts)]
    (response file)))
Vars in ring.util.response/file-response: defn if-let
Used in 0 other vars

Comments top

No comments for file-response. Log in to add a comment.