if i have a script like this
#!/usr/bin/env bb
(require '[app.routes :as r])
(r/route)
is it possible to require this namespace? if it resides in app/routes.clj?im curious what you mean by cgi? what is your vision for this? @mathaeus.peter.sander
In the past perl and php were just cgi languages and evolved later in fastcgi or other tech to devolop rich webappa. My idea is like i saw in an aeticle to uae babashka just like that. Build a simple script to generate rich webapps like it was done at the beginning of the web. Simple and easy ;)
yes, but you need to add the local directory to the classpath, either via bb.edn or some other way
yeah i'm currently working on my cgi idea 😄 and i would like to use plain clojure syntax. So i have this as main.clj file and everything else is "normal" clojure syntax with namespaces and stuff. so i have to find a way to easily add the classbath.
you can do it like this:
(babashka.classpath/add-classpath ".")are there any downsides? performance wise or something like that. I have something in the back of my mind that there was something with dynamically creating stuff in clojure
no performance issues
than i might release something new based on babashka 😄 for the brave hearts out there
for the brave and true \m/
wow it works 😮 my idea works 😮
maybe if someone is interested 😄 here my current work in progrress https://github.com/m3tti/babashka.cgi