   (GET "/link/:productid" request (views/link-view request))
   (GET "/login" {session :session}  (views/not-logged-in session))
   (POST "/login" request (views/login request))
+  (POST "/newlink" request (str request))
   (POST "/register" request (views/attempt-register request))
   (GET "/test" request (views/session-test request))
   (route/resources "/bootstrap")

; Run test server with `lein ring server-headless`
(ns hackerati-interval-web-app.core
  (:require  [compojure.core :refer :all]
             [compojure.handler :as handler]


;; Scheduled task must go first, otherwise won't get executed.
(defn -main [& [port]]
  (if-let [port (try 
                  (Integer/parseInt port) 
                  (catch Exception e))] 
    (do
      (System/setProperty "java.awt.headless" "true")
      (scheduled-task db/refresh-prices)
      (jetty/run-jetty app 
                      {:port port :auto-reload? true}))
    (println "Useage: lein run port")))

