Skip to content

Instantly share code, notes, and snippets.

@tobias

tobias/core.clj Secret

Created May 3, 2017 15:37
Show Gist options
  • Save tobias/435fcc19fff9eab62915f960ef014947 to your computer and use it in GitHub Desktop.
Save tobias/435fcc19fff9eab62915f960ef014947 to your computer and use it in GitHub Desktop.
(ns head.core
(:require [immutant.web :as web]
[immutant.web.async :as async])
(:gen-class))
(defn handler
[req]
(async/as-channel req
:on-open (fn [ch]
(if (= :head (:request-method req))
(async/send! ch "" :on-success (partial async/close ch))
(async/send! ch "foo")))))
(defn -main [& args]
(web/run handler))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment