Last active
June 7, 2020 02:35
-
-
Save renatoalencar/1148cbd0191fd741ae8c4443a00d295b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ;; | |
| ;; Apesar de podermos fazer isso diretamente no `-main`, aqui | |
| ;; podemos separar a responsabilidade de interpretar as | |
| ;; opcoes e passar para os respectivos constructores dos | |
| ;; componentes. | |
| ;; | |
| (defn system [& options] | |
| (let [{:keys [database-url port]} options] | |
| (component/system-map | |
| :database (new-database database-url) | |
| :app (new-app list-users-handler) | |
| :server (new-web-server port)))) | |
| (defn -main | |
| [& args] | |
| (component/start (system :database-url (System/getenv "DATABASE_URL") | |
| :port 3000))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment