Skip to content

Commit

Permalink
Remove unnecessary flags
Browse files Browse the repository at this point in the history
  • Loading branch information
skydread1 committed Jul 29, 2023
1 parent e821543 commit 2c85624
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
6 changes: 4 additions & 2 deletions config/sys.edn
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{:env :dev ;; can be either :dev or :prod
:systems {:prod {:http-port 8123
;; note the initial `/` because prod system is run in a container
;; note the initial `/` because prod-system is run in a container
:db-uri "/datalevin/prod/flybotdb"
:oauth2-callback "https://flybot.sg/oauth/google/callback"}
:dev {:http-port 8123
:db-uri "datalevin/dev/db"
:oauth2-callback "http://localhost:8123/oauth/google/callback"}
:figwheel {:db-uri "datalevin/figwheel/db"
:oauth2-callback "http://localhost:9500/oauth/google/callback"
;; "flybot-app://" for mobile, default to "/" for web
;; where the user is redirected after oatuh2:
;; "flybot-app://" for mobile
;; default to "/" for web
:client-root-path "/"}
:test {:http-port 8100
:db-uri "datalevin/test/db"}}
Expand Down
19 changes: 8 additions & 11 deletions server/src/flybot/server/systems.clj
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@
Figwheel just needs a handler and starts its own server hence we dissoc the http-server.
If some changes are made in one of the backend component (such as handler for instance),
you can halt!, reload ns and touch again the system."
(when (= :dev ENV)
(-> (config/system-config :figwheel)
system
(assoc :db-conn (db-conn-system id/init-data))
(dissoc :http-port :http-server))))
(-> (config/system-config :figwheel)
system
(assoc :db-conn (db-conn-system id/init-data))
(dissoc :http-port :http-server)))

(def figwheel-handler
"Provided to figwheel-main.edn.
Expand All @@ -102,9 +101,8 @@
"The dev system starts a server on port 8123.
It loads some real data sample. The data is deleted when the system halt!.
It is convenient if you want to see your backend changes in action in the UI."
(when (= :dev ENV)
(-> (system (config/system-config :dev))
(assoc :db-conn (db-conn-system id/init-data)))))
(-> (system (config/system-config :dev))
(assoc :db-conn (db-conn-system id/init-data))))

(comment
(touch dev-system)
Expand All @@ -118,9 +116,8 @@
"The prod system starts a server on port 8123.
It does not load any init-data on touch and it does not delete any data on halt!.
You can use it in your local environment as well."
(when (= :prod ENV)
(let [prod-cfg (config/system-config :prod)]
(system prod-cfg))))
(let [prod-cfg (config/system-config :prod)]
(system prod-cfg)))

(comment
(touch prod-system)
Expand Down

0 comments on commit 2c85624

Please sign in to comment.