summaryrefslogtreecommitdiff
path: root/init.fnl
blob: bce021aad91fe7942d310198248c43c7a169862f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(local fennel (require :fennel))
(local html (require :html))

(local template
 [:html {:lang "en"}
  [:head {}
   [:meta {:charset "UTF-8"}]
   [:title {} "A new cool web server for lua"]]
  [:body {}
   [:h1 {} "Hello!"]
   [:pre {} "This is my super blog!"]]])

(fn root-handler [method path headers body]
  (let [headers { :content-type "text/html" }]
    (values 200 headers (html.render template))))

{ :routes { :/ root-handler } }