CrossClj

1.0.1 docs

SourceDocs


project

docs index

NAMESPACES
aleph-system

RECENT

    aleph-system

    Clojars

    Sep 14, 2015


    OWNER
    Martin Skou
    Infoserv Hosting
    Denmark
    msj@infoserv.dk
    infoserv-hosting.dk

    Readme

    Index of all namespaces


    The README below is fetched from the published project artifact. Some relative links may be broken.

    Aleph-system

    Small wrapper for Clojure, Aleph server and Bidi routing.

    Usage

    Clojars Project

    Example, starts Aleph webserver at http://localhost:9990/

    (ns ...
      (:require
      ...
      [ring.util.response :refer :all]
      [hiccup.page :refer :all]
      [hiccup.core :refer :all]
      [aleph-system.core :as asystem])
      ...
    )
    
    (defn home [req]
      (response (html5 [:head [:title "Aleph-system"]] [:body "Home"])))
    
    (defn setup [] {:port 9990
                    :cookie-name "somename"
                    :cookie-store-key "somekeysomekeyso"
                    :routes ["/" [
                                  ["" home]
                                  ["a/" (fn [req] (pprint req) (response "B"))] 
                                  ["j/" (fn [req] (response {:a "abc" :b 13}))] 
                                  ["resources/" (asystem/resources)]
                                  [#".*" (fn [req] (not-found "Ups"))]
                             ]]
                     })
                     
                     
    (asystem/system-restart setup)
    

    License

    Copyright © 2015 Martin Skou Drewes

    Distributed under the Apache License.