<commit_before>(ns secret-shame.core
  (:use ring.util.response)
  (:require [compojure.handler :refer [site] :as handler]
            [compojure.route :as route]
            [compojure.core :refer [GET POST defroutes]]
            [hiccup.core :refer [html]]
            [hiccup.page :refer [include-js include-css]]
            [ring.adapter.jetty :as jetty]
            [ring.middleware.json :as middleware]
            [ring.middleware.stacktrace :as trace]
            [ring.middleware.session :as session]
            [ring.middleware.session.cookie :as cookie] 
            [environ.core :refer [env]]))

(defn index []
  (html
   [:html
    [:head
     (include-css "bootstrap/dist/css/bootstrap.css")
     (case :desktop
       
       ;; Bootcards CSS for iOS:
       :ios (include-css "bootcards/dist/css/bootcards-ios.min.css")

       ;;  Bootcards CSS for Android: 
       :android (include-css "bootcards/dist/css/bootcards-android.min.css")

       ;;  Bootcards CSS for desktop: 
       :desktop (include-css "bootcards/dist/css/bootcards-desktop.min.css"))
     (include-css "//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css")
     (include-css "css/app.css")]
    [:body
     [:div.row
      [:div.col.col-xs-12.col-md-12
       [:div#content]]]
     (include-js "bootstrap/dist/js/jquery.js")
     (include-js "bootstrap/dist/js/bootstrap.js")
     (include-js "bootcards/dist/js/bootcards.min.js")
     (include-js "http://fb.me/react-0.9.0.js")
     (include-js "js/out/goog/base.js")
     (include-js "js/app.js")
     [:script {type "text/javascript"} "goog.require(\"secret_shame.core\");"]]]))

(defn error [msg]
  (html
   [:html
    [:head]
    [:body
     [:div msg]]]))

(defn wrap-error-page [handler]
  (fn [req]
    (try (handler req)
         (catch Exception e
           {:status 500
            :headers {"Content-Type" "text/html"}
            :body (error "Something terrible happened on the server")}))))

(defroutes app-routes
  ;; (GET  "/" [] (resource-response "index.html" {:root "public"}))
  (GET "/" [] (index))
  (GET  "/hello" [] "hello")
  (GET  "/widgets" [] (response [{:name "Widget 1"} {:name "Widget 2"}]))
  (GET  "/bridgets" [] (response [{:name "Bridget 1"} {:name "Bridget 2"}]))
  
  (route/resources "/")
  (route/not-found "Page not found"))

(def app<commit_msg>changed react url to https<commit_after>(ns secret-shame.core
  (:use ring.util.response)
  (:require [compojure.handler :refer [site] :as handler]
            [compojure.route :as route]
            [compojure.core :refer [GET POST defroutes]]
            [hiccup.core :refer [html]]
            [hiccup.page :refer [include-js include-css]]
            [ring.adapter.jetty :as jetty]
            [ring.middleware.json :as middleware]
            [ring.middleware.stacktrace :as trace]
            [ring.middleware.session :as session]
            [ring.middleware.session.cookie :as cookie] 
            [environ.core :refer [env]]))

(defn index []
  (html
   [:html
    [:head
     (include-css "bootstrap/dist/css/bootstrap.css")
     (case :desktop
       
       ;; Bootcards CSS for iOS:
       :ios (include-css "bootcards/dist/css/bootcards-ios.min.css")

       ;;  Bootcards CSS for Android: 
       :android (include-css "bootcards/dist/css/bootcards-android.min.css")

       ;;  Bootcards CSS for desktop: 
       :desktop (include-css "bootcards/dist/css/bootcards-desktop.min.css"))
     (include-css "//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css")
     (include-css "css/app.css")]
    [:body
     [:div.row
      [:div.col.col-xs-12.col-md-12
       [:div#content]]]
     (include-js "bootstrap/dist/js/jquery.js")
     (include-js "bootstrap/dist/js/bootstrap.js")
     (include-js "bootcards/dist/js/bootcards.min.js")
     (include-js "https://fb.me/react-0.9.0.js")
     (include-js "js/out/goog/base.js")
     (include-js "js/app.js")
     [:script {type "text/javascript"} "goog.require(\"secret_shame.core\");"]]]))

(defn error [msg]
  (html
   [:html
    [:head]
    [:body
     [:div msg]]]))

(defn wrap-error-page [handler]
  (fn [req]
    (try (handler req)
         (catch Exception e
           {:status 500
            :headers {"Content-Type" "text/html"}
            :body (error "Something terrible happened on the server")}))))

(defroutes app-routes
  ;; (GET  "/" [] (resource-response "index.html" {:root "public"}))
  (GET "/" [] (index))
  (GET  "/hello" [] "hello")
  (GET  "/widgets" [] (response [{:name "Widget 1"} {:name "Widget 2"}]))
  (GET  "/bridgets" [] (response [{:name "Bridget 1"} {:name "Bridget 2"}]))
  
  (route/resources "/")
  (route/not-found "Page not found"))

(def app
{'fraction_non_alphanumeric': 0.17757009345794392, 'fraction_numerical': 0.007221750212404418, 'mean_word_length': 2.5063291139240507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1757597', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1616, 'n_words': 337}