2016-11-20 20:04:52 +01:00
|
|
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
;;
|
2020-01-13 23:52:31 +01:00
|
|
|
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
|
|
|
;; defined by the Mozilla Public License, v. 2.0.
|
|
|
|
;;
|
2020-05-26 12:28:35 +02:00
|
|
|
;; Copyright (c) 2020 UXBOX Labs SL
|
2016-11-20 20:04:52 +01:00
|
|
|
|
2020-08-18 19:26:37 +02:00
|
|
|
(ns app.main
|
2020-01-23 17:53:26 +01:00
|
|
|
(:require
|
2020-12-04 16:01:33 +01:00
|
|
|
[app.config :as cfg]
|
|
|
|
[clojure.tools.logging :as log]
|
2020-01-31 19:12:58 +01:00
|
|
|
[mount.core :as mount]))
|
|
|
|
|
|
|
|
(defn- enable-asserts
|
|
|
|
[_]
|
2020-08-18 19:26:37 +02:00
|
|
|
(let [m (System/getProperty "app.enable-asserts")]
|
2020-01-31 19:12:58 +01:00
|
|
|
(or (nil? m) (= "true" m))))
|
|
|
|
|
|
|
|
;; Set value for all new threads bindings.
|
|
|
|
(alter-var-root #'*assert* enable-asserts)
|
2016-11-20 20:04:52 +01:00
|
|
|
|
2020-02-01 01:13:50 +01:00
|
|
|
;; Set value for current thread binding.
|
|
|
|
(set! *assert* (enable-asserts nil))
|
|
|
|
|
2020-01-23 17:53:26 +01:00
|
|
|
;; --- Entry point
|
2016-11-20 20:04:52 +01:00
|
|
|
|
2020-08-18 18:46:39 +02:00
|
|
|
(defn run
|
2020-12-02 12:36:08 +01:00
|
|
|
[_params]
|
2020-12-04 16:01:33 +01:00
|
|
|
(require 'app.srepl.server
|
2020-12-09 16:48:26 +01:00
|
|
|
'app.services
|
2020-08-18 19:26:37 +02:00
|
|
|
'app.migrations
|
|
|
|
'app.worker
|
|
|
|
'app.media
|
|
|
|
'app.http)
|
2020-12-04 16:01:33 +01:00
|
|
|
(mount/start)
|
|
|
|
(log/infof "Welcome to penpot! Version: '%s'." (:full @cfg/version)))
|
2020-08-18 18:46:39 +02:00
|
|
|
|
|
|
|
(defn -main
|
2020-12-02 12:36:08 +01:00
|
|
|
[& _args]
|
2020-08-18 18:46:39 +02:00
|
|
|
(run {}))
|