Page Details:
Noir
http://www.webnoir.org/Get StartedTutorialsGoogle GroupAPISrcThe Clojure web framework (ns my-app (:use noir.core) (:require [noir.server :as server])) (defpage "/welcome" [] "Welcome to Noir!") (server/start 8080 {}) Noir is a micro-framework that allows you to rapidly develop websites in Clojure. And it couldn't be any simpler. lein plugin install lein-noir 1.0.0 lein noir new my-website cd my-website lein run Make sure you have leiningen installed, that way we can use the lein-noir plugin to create a new noir project. Four commands later, your site is up and running. Now let's make it do something. Noir uses Hiccup to generate HTML. Hiccup represents html elements as vectors where the first keyword is the name of the tag and everything else is the content. With Noir you can define functions that return HTML by using the (defpartial) macro. The code to the right, for example, shows how you could generate an unordered list of todos. (defpartial todo-item [{:keys [id title due]}] [:li {:id id}
Tags: clojure, framework, web, noir, webdev, webapp, development, opensource, webdesign, compojure Saved by: admin