public
Created

simple Noir app

  • Download Gist
gistfile1.lisp
Common Lisp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
(ns small-site.server
(:require [noir.server :as server]
[noir.content.pages :as pages]
[clj-http.client :as client])
(:use noir.core
hiccup.core
hiccup.page-helpers))
 
(def code (slurp "src/small_site/server.clj"))
(def hilite-url "http://hilite.me/api")
(def params {:form-params {:code code :lexer "clojure"}})
(def response (:body (client/post hilite-url params)))
 
(defpage "/" []
(html5
[:head
[:title "small-site"]]
[:body
[:h3 "I am the smallest Noir app!"]
[:p "Here is my source code:"]
[:p response]]))
 
(defn -main [& args]
(let [mode (keyword (or (first args) :dev))]
(server/start 8080 {:mode mode :ns 'small-site})))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.