mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 23:31:39 +02:00
🎉 Add initial exporter (nodejs) application.
This commit is contained in:
parent
d521416329
commit
c2db6d4f35
10 changed files with 1048 additions and 0 deletions
36
exporter/src/app/core.cljs
Normal file
36
exporter/src/app/core.cljs
Normal file
|
@ -0,0 +1,36 @@
|
|||
(ns app.core
|
||||
(:require
|
||||
[lambdaisland.glogi :as log]
|
||||
[lambdaisland.glogi.console :as glogi-console]
|
||||
[promesa.core :as p]
|
||||
[app.http :as http]
|
||||
[app.config]
|
||||
[app.browser :as bwr]))
|
||||
|
||||
(glogi-console/install!)
|
||||
(enable-console-print!)
|
||||
|
||||
(defonce state (atom nil))
|
||||
|
||||
(defn start
|
||||
[& args]
|
||||
(log/info :msg "initializing")
|
||||
(p/let [browser (bwr/start!)
|
||||
server (http/start! {:browser browser})]
|
||||
(reset! state {:http server
|
||||
:browser browser})))
|
||||
|
||||
(def main start)
|
||||
|
||||
(defn stop
|
||||
[done]
|
||||
;; an empty line for visual feedback of restart
|
||||
(js/console.log "")
|
||||
|
||||
(log/info :msg "stoping")
|
||||
(p/do!
|
||||
(when-let [instance (:browser @state)]
|
||||
(bwr/stop! instance))
|
||||
(when-let [instance (:http @state)]
|
||||
(http/stop! instance))
|
||||
(done)))
|
Loading…
Add table
Add a link
Reference in a new issue