Created
August 17, 2016 17:28
-
-
Save mh120888/bee89f0255d4ae22f471c109c83fc13a to your computer and use it in GitHub Desktop.
basic-hosted-ttt
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 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