Skip to content

Instantly share code, notes, and snippets.

(def app
(->
(castra 'castra.api)
(wrap-cors #".*")
(wrap-session {:store (cookie-store {:key "a 16-byte secret"})})))
(deftask run-server
"run the castra server"
[]
(comp
(watch)
(serve :handler 'castra.core/app :port 3000)))
(def app
(->
(castra 'server.api)
(wrap-session {:store (cookie-store {:key "a 16-byte secret"})})
(wrap-resource )
(wrap-file )
(wrap-index-paths "/index.html")
(wrap-file-info)
(wrap-cors #".*")
))
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" metadata-complete="true" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>boot-webapp</display-name>
<description>boot-webapp</description>
<servlet>
<servlet-name>boot-webapp</servlet-name>
<servlet-class>tailrecursion.ClojureAdapterServlet</servlet-class>
<init-param>
<param-name>serve</param-name>
<param-value>castra.core/app</param-value>
(deftask build-tomcat
"build tomcat package"
[]
(set-env! :target-path "target")
(comp
(prod)
(web)
(uber :as-jars true)
(war)))
(defn stripe-init! []
(do
(.setPublishableKey js/Stripe @stripe-pub-key)
(reset! stripe-ready? true)))
(defn ensure-stripe []
(.getScript js/jQuery stripe-url #(stripe-init!)))
(defn get-query-params []
(let [qp (.-search (.-location js/window))]
(.log js/console "QP: " (clj->js qp))))
<script type="text/hoplon">
(page "test.html")
</script>
<html>
<head>
<title>Test</title>
</head>
<body>
(def app (->
(castra 'server.api)
(wrap-session {:store (cookie-store {:key "chabadncampusrox"})})
(task-options!
serve {:handler 'server.core/app
:init 'server.config/local-init
:reload true})