Hi! I have more of a general question. Can a single backend serve multiple frontends? So the scena...
w
Hi! I have more of a general question. Can a single backend serve multiple frontends? So the scenario is:
backend
- on server A
frontend
- on server B, trying to contact the backend on server A
frontend-local
- locally, trying to contact the backend on server A I guess, I can have multiple backends, to cater to the 2 types like
backend
and
backend-local
, where backend is setup towards frontend (on server B) and backend-local where our local IP address is set for CORS and website name localhost with a port and tweak a bit the devops ot deploy the same code base to backend and backend-local, and both backends can connect to same `core`and databases. however this sounds a bit tidious, as I am new to this library, is there a way to support this functionality (both frontends) from a single backend
r
hey @whydinkov - it is possible to do this. You will just have to set the websiteDomain on the backend to be one of the values of your frontend (preferably the non local one)
You also would need to set the cookieSameSite on the backend to
none
in session.init. When the local frontend queries the backend, it will mostly work other than email verification links which will point to the websiteDomain instead of the local site. But this can be changed if you override the sendEmail function to change the domain on the url based on the request origin.
w
Thanks @rp_st, will try that 🙂
7 Views