mirror of
https://github.com/penpot/penpot.git
synced 2025-02-12 18:18:24 -05:00
🎉 Add socket repl.
This commit is contained in:
parent
29180e4196
commit
4ad08a7449
4 changed files with 36 additions and 1 deletions
|
@ -37,7 +37,6 @@
|
|||
funcool/promesa {:mvn/version "5.1.0"}
|
||||
funcool/cuerdas {:mvn/version "2020.03.26-3"}
|
||||
|
||||
|
||||
buddy/buddy-core {:mvn/version "1.8.0"}
|
||||
buddy/buddy-hashers {:mvn/version "1.6.0"}
|
||||
buddy/buddy-sign {:mvn/version "3.2.0"}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
(defn run
|
||||
[params]
|
||||
(require 'app.config
|
||||
'app.srepl.server
|
||||
'app.migrations
|
||||
'app.worker
|
||||
'app.media
|
||||
|
|
5
backend/src/app/srepl/main.clj
Normal file
5
backend/src/app/srepl/main.clj
Normal file
|
@ -0,0 +1,5 @@
|
|||
(ns app.srepl.main
|
||||
"A main namespace for server repl."
|
||||
(:require
|
||||
[clojure.pprint :refer [pprint]]
|
||||
[app.db :as db]))
|
30
backend/src/app/srepl/server.clj
Normal file
30
backend/src/app/srepl/server.clj
Normal file
|
@ -0,0 +1,30 @@
|
|||
(ns app.srepl.server
|
||||
"Server Repl."
|
||||
(:require
|
||||
[clojure.pprint :refer [pprint]]
|
||||
[clojure.main :as cm]
|
||||
[clojure.core.server :as ccs]
|
||||
[app.srepl.main]
|
||||
[mount.core :as mount :refer [defstate]]))
|
||||
|
||||
(defn- repl-init
|
||||
[]
|
||||
(ccs/repl-init)
|
||||
(in-ns 'app.srepl.main))
|
||||
|
||||
(defn repl
|
||||
[]
|
||||
(cm/repl
|
||||
:init repl-init
|
||||
:read ccs/repl-read))
|
||||
|
||||
(defstate server
|
||||
:start (ccs/start-server
|
||||
{:address "127.0.0.1"
|
||||
:port 6061
|
||||
:name "main"
|
||||
:accept 'app.srepl.server/repl})
|
||||
:stop (ccs/stop-server "main"))
|
||||
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue