-
-
Save tobias/435fcc19fff9eab62915f960ef014947 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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