                      :or {ip "0.0.0.0" port 8080}}]
   (apply react (conj (setup port) router)))
 
-
-;; what I want to do:
-;;
-;; read the full HTTP request in (asynchronously)
-;; then put any content into the in-channel
-;; then route based on the path
-;; so GET /foo HTTP/1.1 will route a :get
-;; (route :get path in-port out-port)
-;;
-;; to do this, I need to buffer all of the content until I've read all of the header
-;; information, and then I'll immediately route, and take any content I have at that
-;; point and dump it onto in-chan.
-;; if/when I get more content, I dump that onto in-chan as well,
-;; and I dump a :closed token onto in-chan when I get there.
-;;
-;;
-
 (def ^:dynamic ^{:private true} *out-channel nil)
 (def ^:dynamic ^{:private true} *in-channel nil)
 (def ^:dynamic ^{:private true} *path nil)


(run (route {:get
             {"/foo" {"/bing" bing}
              "/" home}}))

           (java.io IOException))
  (:require [clojure.core.async :as async :refer [go go-loop >! <! <!! >!! chan]]
            [clojure.string :as string :refer [join split]]))

(def *buffer* (ByteBuffer/allocate 16384)) ;; 16k...

