Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: dce710537e
Fetching contributors…

Cannot retrieve contributors at this time

68 lines (49 sloc) 1.63 kB


A lightweight web development framework, building on top of Clojure/Compojure. (Highly experimental and draft). Currently allows template files with embedded Clojure.

Using Clojure Templates

There is a default template server defined that tries to load the file against the current directory, and returns the executed template.

To set up a server, all that is required is:

(use 'gulliver)

(defserver web-server
  {:port 8080}
  "/*"  (servlet gulliver/template-servlet))

(start web-server)


Each file is compiled into a single routine, render, which takes the request. Every file has its own namespace; for example, if you have a file /admin/edituser.clj, then the render routine would be admin.edituser.clj/render.


An example:

(import 'java.util.Date)

    <h1>Delivered via Gulliver</h1>
    <p>Expressions at work: <?= (+ 2 2) ?></p>
    <? (dotimes [x 10] ?>
      <li><?= x ?></li>
    <? ) ?>

    <p>Here's a date:  <?= (Date.) ?></p>


  • Intrafile references. need a way of referring to the code in other files. You can use the "use" macro, but if the other file hasn't been loaded yet then the namespace won't exist. Ugh. Probably need to add a "require" equivalent a la PHP.
  • Performance. Currently, a stat is done everytime a page is rendered; it should really on a variable expire.
  • Need to make it easier to access params and whatnot.
Jump to Line
Something went wrong with that request. Please try again.