From c03868a7befd8cdaedbc9a2e58e1c870351edd68 Mon Sep 17 00:00:00 2001 From: Wade Mealing Date: Mon, 30 Oct 2023 05:23:12 +1000 Subject: [PATCH] Code upload is working. --- src/barista-routes.lfe | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/barista-routes.lfe b/src/barista-routes.lfe index 7fdcdcc..c7545e7 100644 --- a/src/barista-routes.lfe +++ b/src/barista-routes.lfe @@ -76,7 +76,7 @@ ('PUT #"/live-demo/user-html" (progn - ;; FIXME: save the page in priv/user/user-demo.html + (write-to-file "priv/user/live.html" (maps:get "user-html" (barista-request:get-data req))) (barista-response:ok "page saved"))) ('GET #"/live-demo/user-lfe" @@ -85,8 +85,6 @@ ('PUT #"/live-demo/user-lfe" (progn - ;; (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"))))) @@ -97,6 +95,7 @@ ('GET #"/go" (progn + (users-lfe:demo-handler (list_to_atom (mref req 'method)) (mref req 'path) req) (barista-response:ok (erlang:binary_to_list (template:load "user/live.html"))))) ('GET #"/about"