diff --git a/priv/live.html b/priv/live.html index b25f640..49a1f69 100644 --- a/priv/live.html +++ b/priv/live.html @@ -122,7 +122,7 @@

LFE Code

- + Test this code

diff --git a/spawnfest-manifest.md b/spawnfest-manifest.md index f4dc2ac..6082184 100644 --- a/spawnfest-manifest.md +++ b/spawnfest-manifest.md @@ -30,6 +30,7 @@ Note: - No AI was used in the making of this project. - Github actions run tests ! - Github actions builds (but doesn't publish) a container, thats on my list. + - compiler errors dont make it back to the user, this is a big one. Barista isnt showing what happens to error 500s! I had to bruteforce error conditions ! diff --git a/src/barista-routes.lfe b/src/barista-routes.lfe index ef70f3c..7fdcdcc 100644 --- a/src/barista-routes.lfe +++ b/src/barista-routes.lfe @@ -23,10 +23,9 @@ (defun write-to-file (filename data) (file:write_file filename data )) - ;;compile a file (defun compile-file (filename) - (: lfe-shell c filename)) + (: lfe_comp file filename)) ;; compile it. (defun compile-data (data) @@ -86,14 +85,19 @@ ('PUT #"/live-demo/user-lfe" (progn - (compile-data (barista-request:get-data req)) + ;; (logger:alert (barista-request:get-data req)) + (logger:alert (maps:get "user-lfe" (barista-request:get-data req))) + (write-to-file "/tmp/user-demo.lfe" (maps:get "user-lfe" (barista-request:get-data req))) + (compile-file "/tmp/user-demo.lfe") (barista-response:ok (erlang:binary_to_list (template:load "template-lfe.html"))))) ('GET #"/live-demo" (progn (barista-response:ok (erlang:binary_to_list (template:load "live.html"))))) - + ('GET #"/go" + (progn + (barista-response:ok (erlang:binary_to_list (template:load "user/live.html"))))) ('GET #"/about" (progn