diff --git a/examples/README.md b/examples/README.md index dbc42b05..5ba38703 100644 --- a/examples/README.md +++ b/examples/README.md @@ -7,6 +7,13 @@ ## frontend-prompt ## frontend-re-frame ## frontend + +Frontend example with clojure.spec coercion. + +## frontend-malli + +Frontend example with Malli coercion. + ## http-swagger Coercion with Spec and Swagger generation. diff --git a/examples/frontend-malli/README.md b/examples/frontend-malli/README.md new file mode 100644 index 00000000..80db6052 --- /dev/null +++ b/examples/frontend-malli/README.md @@ -0,0 +1,13 @@ +# reitit-frontend example + +## Usage + +```clj +> lein figwheel +``` + +Go with browser to http://localhost:3449 + +## License + +Copyright © Metosin Oy and collaborators diff --git a/examples/frontend-malli/checkouts/reitit-core b/examples/frontend-malli/checkouts/reitit-core new file mode 120000 index 00000000..a59d247e --- /dev/null +++ b/examples/frontend-malli/checkouts/reitit-core @@ -0,0 +1 @@ +../../../modules/reitit-core \ No newline at end of file diff --git a/examples/frontend-malli/checkouts/reitit-frontend b/examples/frontend-malli/checkouts/reitit-frontend new file mode 120000 index 00000000..20cdd448 --- /dev/null +++ b/examples/frontend-malli/checkouts/reitit-frontend @@ -0,0 +1 @@ +../../../modules/reitit-frontend \ No newline at end of file diff --git a/examples/frontend-malli/checkouts/reitit-schema b/examples/frontend-malli/checkouts/reitit-schema new file mode 120000 index 00000000..a68c7f05 --- /dev/null +++ b/examples/frontend-malli/checkouts/reitit-schema @@ -0,0 +1 @@ +../../../modules/reitit-schema \ No newline at end of file diff --git a/examples/frontend-malli/project.clj b/examples/frontend-malli/project.clj new file mode 100644 index 00000000..13579427 --- /dev/null +++ b/examples/frontend-malli/project.clj @@ -0,0 +1,55 @@ +(defproject frontend "0.1.0-SNAPSHOT" + :description "FIXME: write description" + :url "http://example.com/FIXME" + :license {:name "Eclipse Public License" + :url "http://www.eclipse.org/legal/epl-v10.html"} + + :dependencies [[org.clojure/clojure "1.10.1"] + [ring-server "0.5.0"] + [reagent "0.10.0"] + [ring "1.8.1"] + [hiccup "1.0.5"] + [org.clojure/clojurescript "1.10.773"] + [metosin/reitit "0.7.0-alpha7"] + [metosin/reitit-malli "0.7.0-alpha7"] + [metosin/reitit-frontend "0.7.0-alpha7"] + ;; Just for pretty printting the match + [fipp "0.6.23"]] + + :plugins [[lein-cljsbuild "1.1.8"] + [lein-figwheel "0.5.20"]] + + :source-paths [] + :resource-paths ["resources" "target/cljsbuild"] + + :profiles {:dev {:dependencies [[binaryage/devtools "1.0.2"]]}} + + :cljsbuild + {:builds + [{:id "app" + :figwheel true + :source-paths ["src"] + :watch-paths ["src" "checkouts/reitit-frontend/src"] + :compiler {:main "frontend.core" + :asset-path "/js/out" + :output-to "target/cljsbuild/public/js/app.js" + :output-dir "target/cljsbuild/public/js/out" + :source-map true + :optimizations :none + :pretty-print true + :preloads [devtools.preload] + :aot-cache true}} + {:id "min" + :source-paths ["src"] + :compiler {:output-to "target/cljsbuild/public/js/app.js" + :output-dir "target/cljsbuild/public/js" + :source-map "target/cljsbuild/public/js/app.js.map" + :optimizations :advanced + :pretty-print false + :aot-cache true}}]} + + :figwheel {:http-server-root "public" + :server-port 3449 + :nrepl-port 7002 + ;; Server index.html for all routes for HTML5 routing + :ring-handler backend.server/handler}) diff --git a/examples/frontend-malli/resources/public/index.html b/examples/frontend-malli/resources/public/index.html new file mode 100644 index 00000000..ce1dd45b --- /dev/null +++ b/examples/frontend-malli/resources/public/index.html @@ -0,0 +1,10 @@ + + +
+