Skip to content

Instantly share code, notes, and snippets.

@maacl
Created August 25, 2011 20:57
Show Gist options
  • Save maacl/1171916 to your computer and use it in GitHub Desktop.
Save maacl/1171916 to your computer and use it in GitHub Desktop.
ringerfinger
(ns rf-test.core
(:use (ringfinger core resource fields db auth auth-routes), ringfinger.db.inmem,
ringfinger.timesavers.hooks,
ring.util.serve))
(make-user inmem :ringfinger_auth {:username "test"} "demo" "salt")
(defresource contacts
{:db inmem
:pk :name_slug
:hooks {:data (make-slug-for :name)}}
[:name (required) "sorry, anonymous"]
[:bday (date-field) "invalid date"]
[:email (email-field) "invalid email"])
(defapp myapp
{:static-dir "public"
:session-db inmem
:auth-db inmem}
contacts
(auth-routes {:db inmem}))
(serve myapp 3000)
(defproject rf-test "0.0.1-SNAPSHOT"
:description "TODO: add summary of your project"
:dependencies [[clojure "1.2.0"]
[ring "0.3.11"]
[ring-serve "0.1.1"]
[congomongo "0.1.7-SNAPSHOT"]
[ringfinger "0.1.1-SNAPSHOT"]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment