として知られている環境変数を変数に設定しようとしPOWERED_BY
ていますmessage
。message
次に、が空か NULLかをテストしたいと思います。次に、「Powered by」を印刷しますmessage
。
現在、以下のコードは機能しません。
(ns helloworld.web
(:use compojure.core [ring.adapter.jetty :only [run-jetty]] )
(:require [compojure.route :as route]
[compojure.handler :as handler]))
(defroutes main-routes
; what's going on
(def message (System/getenv "POWERED_BY"))
(GET "/" [] (apply str "Powered by " message))
(route/resources "/")
(route/not-found "Page not found") )
(def app
(handler/api main-routes))
(defn -main [port]
(run-jetty app {:port (Integer. port)}))