Question: In an edn file, how can use a function from another file (from the same project)?
@amarjeet Can you give an example?
So, I created a vase app (lein new vase my-app) - here: https://github.com/amarjeet000/vase-demo . Vase does all the routing inside the edn file under the resources folder of the app. Now, I want to hit a 3rd party API. I want to use Exotel's cloud telephony API here. This, I believe, I can do inside the service.clj file only, using clj-http.client. If I do that, how to use the return values inside my api routes, which are in the end file?
*api routes, which are in the EDN file
@amarjeet Are you talking about this file? https://github.com/amarjeet000/vase-demo/blob/master/resources/vase-demo_service.edn
yes
I’m not familiar with Pedestal/Vase, but I’m puzzled why would you write any code in the EDN file. How do you get the stack trace for the code in such EDN files?
Vase seems to be enforcing this approach. Route definition in pedestal is in the services.clj file only. Its just vase. And, routes defined inside the edn file are overriding the ones defined in the services.clj file in the vase app.
@amarjeet If you look in the EDN file, there are forms starting with #vase/respond
and #vase/transact
etc. — those are reader literals
for in-depth info on reader literals, you can start here — https://clojuredocs.org/clojure.core/*data-readers*
Vase provides some reader literals, which is like a DSL in this case — you need to lookup Vase documentation for details on that DSL
Inside the reader literals, the control may not be exactly like the usual Clojure code because the reader extension decides how to read and interpret that
yes, Vase has docs on action literals
i think i have to study 1-2 docs, I am looking at them n ow