~technomancy/fennel-lang.org

fennel-lang.org/survey/save.fnl -rw-r--r-- 594 bytes
25a294adPhil Hagelberg Remove the bit about submitting fennelconf 2021 talks. a day ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
;; This is the only piece of code which runs server-side.
;; It takes HTTP POST data on stdin and saves it to disk for later analysis.
(error "Survey is closed!")
(let [contents (io.read "*all")
      ;; we could use os.time but it only has second-level resolution which
      ;; means there is a very slight chance of conflict for two requests.
      date (io.popen "date --rfc-3339=ns")
      id (: (date:read "*a") :sub 1 -2)]
  (with-open [raw (io.open (.. "responses/" id ".raw") :w)]
    (raw:write contents))
  (print "status: 301 redirect")
  (print "Location: /survey/thanks.html\n"))