Can i use Razzle if my backend is java? #1334
-
❓QuestionAs is see there are 2 servers up and running whenever i do npm start? is it mandatory have backend server as well? but i want to achieve server side rendering that's the whole point of using this framework can i do that having backend in java using this framework? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
But this is more of a deployment issue. In dev you should proxy any non browser/backend requests. |
Beta Was this translation helpful? Give feedback.
-
im fine with having a proxy, my only concern is server side rendering rendering, will i be able to achieve with having java in backend? |
Beta Was this translation helpful? Give feedback.
-
i had gone through #1315 , its something where we are embedding react in spring-boot, this is the only option to achieve SSR? cant we do by having frontend in one server and backend in one and connect it by proxy(nginx)? |
Beta Was this translation helpful? Give feedback.
-
That works too. Razzle only starts two servers in dev. I would serve razzle static via nginx at PUBLIC_URL. Then proxy /api to backend and / to express. |
Beta Was this translation helpful? Give feedback.
-
think as you backend as a BlackBox that we don't know what's inside it. the only thing that we know is that Blackbox returns some JSON :) as long as you think about it in this way it doesn't matter which language or framework you used to develop your backend |
Beta Was this translation helpful? Give feedback.
-
@nimaa77 my confusion was with node js, as is used in same framework so I thought Server side Rendering works only if I use node in backend if I'm using this framework |
Beta Was this translation helpful? Give feedback.
-
@kalandher sorry for the delay. yes, you have to install the node js runtime on your server, and since you have two apps that listen on port 80 (node.js app and the java app) you have to use a reverse proxy on that server... |
Beta Was this translation helpful? Give feedback.
That works too. Razzle only starts two servers in dev. I would serve razzle static via nginx at PUBLIC_URL. Then proxy /api to backend and / to express.