juxt / edge

A Clojure application foundation from JUXT
https://juxt.pro/edge/
MIT License
506 stars 62 forks source link

Add yada functionality to serve a local system directory or file #111

Open luciodale opened 5 years ago

luciodale commented 5 years ago

Usage examples:

From your config.edn:

Serve directory:

...
:ig.system/base
{[:my.project/foo :edge.yada.ig/external-directories]
 {:path "/home/user/target/folder/"
  :options {:custom-suffices [...]
            :index-files [...]
             ...}}
...

And in your edge.bidi.ig/vhost:

["/foo/" #ig/ref [:my.project/foo :edge.yada.ig/external-directories]]

Serve single file:

...
:ig.system/base
{[:my.project/bar :edge.yada.ig/external-files]
 {:path "/home/user/target/folder/file.txt"
  :options {:produces [...]
              ...}}
...

And in your edge.bidi.ig/vhost:

["/file" #ig/ref [:my.project/bar :edge.yada.ig/external-files]]