Skip to content

Instantly share code, notes, and snippets.

@mh120888
Created August 17, 2016 17:28
Show Gist options
  • Save mh120888/bee89f0255d4ae22f471c109c83fc13a to your computer and use it in GitHub Desktop.
Save mh120888/bee89f0255d4ae22f471c109c83fc13a to your computer and use it in GitHub Desktop.
basic-hosted-ttt
(ns web-ttt.core
(:gen-class)
(:require [matts-clojure-ttt.game :as game])
(:import [server.MyServer]
[app.Application]
[httpmessage.HTTPResponse]
[cobspecapp.CobSpecApp]
[basichttpmessage.BasicHTTPMessageFactory]))
(def message-factory (basichttpmessage.BasicHTTPMessageFactory.))
(def basic-app (reify app.Application
(getResponse [this request response]
(let [response (.getNewResponse message-factory)]
(if (= "/" (.getPath request))
(.setStatus response 200)
(.setStatus response 404))
response))))
(defn -main
[& args]
(server.MyServer/runServer basic-app message-factory))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment