Loading initial configuration for a site from api endpoint
Unanswered
Satin Angora posted this in #help-forum
Satin AngoraOP
So i am using nextjs as frontend for my laravel api.
I would like to load initial configuration such as theme, etc via endpoint i created.
Right now in my getInitialProps i check if the site_data are in cookie, of not, call the endpoint, and store in the cookie. Then its passed into client as prop and used to dynamically handle theme of the site.
My question is.
Is there any better more efficient approach to solve this issue if i want to use my website for multiple customers, each having their own theme, which is to be loaded via api endpoint. ?
Not necessarily it needs to be loaded via the api endpoint.
I would like to load initial configuration such as theme, etc via endpoint i created.
Right now in my getInitialProps i check if the site_data are in cookie, of not, call the endpoint, and store in the cookie. Then its passed into client as prop and used to dynamically handle theme of the site.
My question is.
Is there any better more efficient approach to solve this issue if i want to use my website for multiple customers, each having their own theme, which is to be loaded via api endpoint. ?
Not necessarily it needs to be loaded via the api endpoint.