Advice on how to enable SSR and CSR at the same time for a modern.js app #7020
-
Hi there I have an application where I need the two rendering strats:
Both will have their own pages. I was wondering what is the correct/recommended implementation for this 🤔 . Right now I have the following: Created two entries:
Then, I have configured modernjs like this: server: {
ssr: true,
ssrByEntries: {
admin: false,
},
}, But the problem now is that all my routes have the entries prefix. Like So for now I'm using this folder structure Created two entries:
But still I was wondering if its ok to use modernjs like this. Maybe its not recommended to mix ssr with csr in the same app? maybe I need to create two separated apps, one for csr and another for ssr? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Your usage is correct, but there's a slight misunderstanding. In server: {
ssr: true,
ssrByEntries: {
csr: false,
},
}, Than, all routes in |
Beta Was this translation helpful? Give feedback.
Your usage is correct, but there's a slight misunderstanding. In
ssrByEntries
, each key represents an entry, not routes. For example, if you havesrc/csr
andsrc/ssr
, then you should configure it as:Than, all routes in
csr
entry is client render.