kitlangton / zio-app

Quickly create and develop full-stack Scala apps with ZIO and Laminar.
124 stars 33 forks source link

Environment-based configuration of DeriveClient #22

Closed forkedcancel closed 3 years ago

forkedcancel commented 3 years ago

An attempt at partially(?) resolving #9.

I used shocon to handle dev and prod application.conf files on the scalajs side. I'm not sure this is the best way of making both ./deploy.sh and zio-app dev send requests to their respective intended backends, but it works, and lets me push a client and server that reside on different (sub)domains.

There are no changes to the backend route generation - being able to push the frontend to firebase and the backend to heroku/dokku was all I was trying to accomplish, hence 'partially.'

kitlangton commented 3 years ago

Wow! That's amazing 😄 Thanks so much for doing this.

I think there's some first-class CORS support for zio-http, but I can muck with that in a follow-up commit. I think I'd prefer some means of code-config over HOCON files—however, this works and fits with a framework paradigm. I may investigate that further in some later PRs, but this gets the job done and makes a lot of sense. Once again, thanks so much!