-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yada functionality to serve a local system directory or file #111
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add docs to doc/resources/doc/sources/built-in-libraries.adoc
@@ -26,6 +26,16 @@ | |||
id | |||
(assoc :id id))) | |||
|
|||
(defmethod ig/init-key ::external-directories | |||
[_ {:keys [path options]}] | |||
(yada.resources.file-resource/new-directory-resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to require this namespace before using it. See requiring-resolve
below.
@@ -26,6 +26,16 @@ | |||
id | |||
(assoc :id id))) | |||
|
|||
(defmethod ig/init-key ::external-directories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe directory-resource is better? Then it can rely on the existing known name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't resource
not ideal because the directory won't be on the classpath?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource would refer to web resource in this context, same as in yada
(yada.resources.file-resource/new-directory-resource | ||
(io/file path) (or options {}))) | ||
|
||
(defmethod ig/init-key ::external-files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file-resource is perhaps better
Usage examples:
From your
config.edn
:Serve directory:
And in your
edge.bidi.ig/vhost
:Serve single file:
And in your
edge.bidi.ig/vhost
: