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
(def app | |
(-> | |
(castra 'castra.api) | |
(wrap-cors #".*") | |
(wrap-session {:store (cookie-store {:key "a 16-byte secret"})}))) |
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
(deftask run-server | |
"run the castra server" | |
[] | |
(comp | |
(watch) | |
(serve :handler 'castra.core/app :port 3000))) | |
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
(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 #".*") | |
)) |
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
<?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> |
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
(deftask build-tomcat | |
"build tomcat package" | |
[] | |
(set-env! :target-path "target") | |
(comp | |
(prod) | |
(web) | |
(uber :as-jars true) | |
(war))) |
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
(defn stripe-init! [] | |
(do | |
(.setPublishableKey js/Stripe @stripe-pub-key) | |
(reset! stripe-ready? true))) | |
(defn ensure-stripe [] | |
(.getScript js/jQuery stripe-url #(stripe-init!))) | |
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
(defn get-query-params [] | |
(let [qp (.-search (.-location js/window))] | |
(.log js/console "QP: " (clj->js qp)))) | |
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
<script type="text/hoplon"> | |
(page "test.html") | |
</script> | |
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> |
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
(def app (-> | |
(castra 'server.api) | |
(wrap-session {:store (cookie-store {:key "chabadncampusrox"})}) | |
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
(task-options! | |
serve {:handler 'server.core/app | |
:init 'server.config/local-init | |
:reload true}) | |