Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
Code upload is working.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmealing committed Oct 29, 2023
1 parent adc1efa commit c03868a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/barista-routes.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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")))))
Expand All @@ -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"
Expand Down

0 comments on commit c03868a

Please sign in to comment.