-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Folcon/master
Adding guestbook-datomic PR
- Loading branch information
Showing
42 changed files
with
1,294 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/target | ||
/lib | ||
/classes | ||
/checkouts | ||
pom.xml | ||
dev-config.edn | ||
test-config.edn | ||
*.jar | ||
*.class | ||
/.lein-* | ||
profiles.clj | ||
/.env | ||
.nrepl-port | ||
/log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
# | ||
# Name of the base image. Capstan will download this automatically from | ||
# Cloudius S3 repository. | ||
# | ||
#base: cloudius/osv | ||
base: cloudius/osv-openjdk8 | ||
|
||
# | ||
# The command line passed to OSv to start up the application. | ||
# | ||
cmdline: /java.so -jar /guestbook-datomic/app.jar | ||
|
||
# | ||
# The command to use to build the application. | ||
# You can use any build tool/command (make/rake/lein/boot) - this runs locally on your machine | ||
# | ||
# For Leiningen, you can use: | ||
#build: lein uberjar | ||
# For Boot, you can use: | ||
#build: boot build | ||
|
||
# | ||
# List of files that are included in the generated image. | ||
# | ||
files: | ||
/guestbook-datomic/app.jar: ./target/uberjar/guestbook-datomic.jar | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM java:8-alpine | ||
MAINTAINER Your Name <[email protected]> | ||
|
||
ADD target/uberjar/guestbook-datomic.jar /guestbook-datomic/app.jar | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["java", "-jar", "/guestbook-datomic/app.jar"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: java -cp target/uberjar/guestbook-datomic.jar clojure.main -m guestbook-datomic.core |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# guestbook-datomic | ||
|
||
generated using Luminus version "2.9.12.62" | ||
|
||
FIXME | ||
|
||
## Prerequisites | ||
|
||
You will need [Leiningen][1] 2.0 or above installed. | ||
|
||
[1]: https://github.com/technomancy/leiningen | ||
|
||
## Running | ||
|
||
To start a web server for the application, run: | ||
|
||
lein run | ||
|
||
Then in a second terminal run: | ||
|
||
lein figwheel | ||
|
||
## License | ||
|
||
Copyright © 2018 FIXME |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
;; WARNING | ||
;; The dev-config.edn file is used for local environment variables, such as database credentials. | ||
;; This file is listed in .gitignore and will be excluded from version control by Git. | ||
|
||
{:dev true | ||
:port 3000 | ||
;; when :nrepl-port is set the application starts the nREPL server on load | ||
:nrepl-port 7000 | ||
|
||
; set your dev database connection URL here | ||
; :database-url "datomic:free://localhost:4334/guestbook_datomic_dev" | ||
; Don't forget you can also use the datomic mem db which can be useful when developing | ||
:database-url "datomic:mem://guestbook_datomic_dev" | ||
} |
10 changes: 10 additions & 0 deletions
10
guestbook-datomic/env/dev/clj/guestbook_datomic/dev_middleware.clj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(ns guestbook-datomic.dev-middleware | ||
(:require [ring.middleware.reload :refer [wrap-reload]] | ||
[selmer.middleware :refer [wrap-error-page]] | ||
[prone.middleware :refer [wrap-exceptions]])) | ||
|
||
(defn wrap-dev [handler] | ||
(-> handler | ||
wrap-reload | ||
wrap-error-page | ||
wrap-exceptions)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns guestbook-datomic.env | ||
(:require [selmer.parser :as parser] | ||
[clojure.tools.logging :as log] | ||
[guestbook-datomic.dev-middleware :refer [wrap-dev]])) | ||
|
||
(def defaults | ||
{:init | ||
(fn [] | ||
(parser/cache-off!) | ||
(log/info "\n-=[guestbook-datomic started successfully using the development profile]=-")) | ||
:stop | ||
(fn [] | ||
(log/info "\n-=[guestbook-datomic has shut down successfully]=-")) | ||
:middleware wrap-dev}) |
12 changes: 12 additions & 0 deletions
12
guestbook-datomic/env/dev/clj/guestbook_datomic/figwheel.clj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(ns guestbook-datomic.figwheel | ||
(:require [figwheel-sidecar.repl-api :as ra])) | ||
|
||
(defn start-fw [] | ||
(ra/start-figwheel!)) | ||
|
||
(defn stop-fw [] | ||
(ra/stop-figwheel!)) | ||
|
||
(defn cljs [] | ||
(ra/cljs-repl)) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(ns user | ||
(:require [guestbook-datomic.config :refer [env]] | ||
[clojure.spec.alpha :as s] | ||
[expound.alpha :as expound] | ||
[mount.core :as mount] | ||
[guestbook-datomic.figwheel :refer [start-fw stop-fw cljs]] | ||
[guestbook-datomic.core :refer [start-app]])) | ||
|
||
(alter-var-root #'s/*explain-out* (constantly expound/printer)) | ||
|
||
(defn start [] | ||
(mount/start-without #'guestbook-datomic.core/repl-server)) | ||
|
||
(defn stop [] | ||
(mount/stop-except #'guestbook-datomic.core/repl-server)) | ||
|
||
(defn restart [] | ||
(stop) | ||
(start)) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns ^:figwheel-no-load guestbook-datomic.app | ||
(:require [guestbook-datomic.core :as core] | ||
[cljs.spec.alpha :as s] | ||
[expound.alpha :as expound] | ||
[devtools.core :as devtools])) | ||
|
||
(set! s/*explain-out* expound/printer) | ||
|
||
(enable-console-print!) | ||
|
||
(devtools/install!) | ||
|
||
(core/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" /> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<!-- encoders are assigned the type | ||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | ||
<encoder> | ||
<charset>UTF-8</charset> | ||
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern> | ||
</encoder> | ||
</appender> | ||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>log/guestbook-datomic.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>log/guestbook-datomic.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<maxFileSize>100MB</maxFileSize> | ||
</timeBasedFileNamingAndTriggeringPolicy> | ||
<!-- keep 30 days of history --> | ||
<maxHistory>30</maxHistory> | ||
</rollingPolicy> | ||
<encoder> | ||
<charset>UTF-8</charset> | ||
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern> | ||
</encoder> | ||
</appender> | ||
<logger name="org.apache.http" level="warn" /> | ||
<logger name="org.xnio.nio" level="warn" /> | ||
<logger name="io.undertow.session" level="warn" /> | ||
<logger name="io.undertow.request" level="warn" /> | ||
<root level="DEBUG"> | ||
<appender-ref ref="STDOUT" /> | ||
<appender-ref ref="FILE" /> | ||
</root> | ||
</configuration> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns guestbook-datomic.env | ||
(:require [clojure.tools.logging :as log])) | ||
|
||
(def defaults | ||
{:init | ||
(fn [] | ||
(log/info "\n-=[guestbook-datomic started successfully]=-")) | ||
:stop | ||
(fn [] | ||
(log/info "\n-=[guestbook-datomic has shut down successfully]=-")) | ||
:middleware identity}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(ns guestbook-datomic.app | ||
(:require [guestbook-datomic.core :as core])) | ||
|
||
;;ignore println statements in prod | ||
(set! *print-fn* (fn [& _])) | ||
|
||
(core/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{:prod true | ||
: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" /> | ||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>log/guestbook-datomic.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>log/guestbook-datomic.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<maxFileSize>100MB</maxFileSize> | ||
</timeBasedFileNamingAndTriggeringPolicy> | ||
<!-- keep 30 days of history --> | ||
<maxHistory>30</maxHistory> | ||
</rollingPolicy> | ||
<encoder> | ||
<charset>UTF-8</charset> | ||
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern> | ||
</encoder> | ||
</appender> | ||
<logger name="org.apache.http" level="warn" /> | ||
<logger name="org.xnio.nio" level="warn" /> | ||
<root level="INFO"> | ||
<appender-ref ref="FILE" /> | ||
</root> | ||
</configuration> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" /> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<!-- encoders are assigned the type | ||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | ||
<encoder> | ||
<charset>UTF-8</charset> | ||
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern> | ||
</encoder> | ||
</appender> | ||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>log/guestbook-datomic.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>log/guestbook-datomic.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<maxFileSize>100MB</maxFileSize> | ||
</timeBasedFileNamingAndTriggeringPolicy> | ||
<!-- keep 30 days of history --> | ||
<maxHistory>30</maxHistory> | ||
</rollingPolicy> | ||
<encoder> | ||
<charset>UTF-8</charset> | ||
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern> | ||
</encoder> | ||
</appender> | ||
<logger name="org.apache.http" level="warn" /> | ||
<logger name="org.xnio.nio" level="warn" /> | ||
<logger name="io.undertow.session" level="warn" /> | ||
<logger name="io.undertow.request" level="warn" /> | ||
<root level="DEBUG"> | ||
<appender-ref ref="STDOUT" /> | ||
<appender-ref ref="FILE" /> | ||
</root> | ||
</configuration> |
Empty file.
Oops, something went wrong.