Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is the website hosted technically? #26

Open
OZZlE opened this issue Jan 12, 2022 · 1 comment
Open

How is the website hosted technically? #26

OZZlE opened this issue Jan 12, 2022 · 1 comment

Comments

@OZZlE
Copy link

OZZlE commented Jan 12, 2022

Does this use Nodejs for serverside rendering? Do you use IISNode?

Or is the FE rendering clientside (JavaScript) only?

Or do you render the content in C#/.Net and run React on top of it? How do you avoid all elements rerendering if so? How do you avoid writing the html twice if so?

The readme doesn't seem to describe how you build and start a server in production and what the prod requirements are (compared to dev reqs)


Sidemark: React doesn't recommend inheritance https://reactjs.org/docs/composition-vs-inheritance.html#so-what-about-inheritance also the latest React syntax, React hooks doesn't really support it https://reactjs.org/docs/hooks-intro.html

@jessycormier
Copy link

FE is Next.JS (react) and is rendered both in browser and back-end using a middleware is rendering SSR (Server Side Rendering) of the site.

Inside of src/Headless.Cms/Startup.cs you'll find this section

#region Headless.CMS Extensions & Services
            services
                .AddJsonConversionStandard()        // Ensure that all JSON responses align with the ContentDeliveryAPI
                .AddFoundationSettings()            // Add settings extension
                .ApplyContentApiExtensions()        // Add extensions for the ContentDeliveryAPI to fully support OPE
                .AddContentActionApi()              // Add Content Actions API
                .AddApiExplorer(options => {        // Add & Configure API Explorer
                    options.DefaultAuthScopes.Add(ContentDefinitionsApiOptionsDefaults.Scope);
                    options.DefaultAuthScopes.Add(ContentManagementApiOptionsDefaults.Scope);
                    options.DefaultAuthScopes.Add(ContentDeliveryApiOptionsDefaults.Scope);
                })
                .AddNodeJs(_configuration)          // Add Frontend proxy
                .AddHeadlessCmsInitialContent();    // Add Initial content
            #endregion

and later on

            #region Headless.CMS Extensions & Services
            app.UseBaaijteOptimizelyImageSharp();
            app.UseFoundationSettings();
            app.UseContentActionApi();
            app.UseApiExplorer();
            app.UseNodeJs();
            #endregion

The section app.UserNodeJs();.
You'll find a folder under the headless.cms project called Infrastructure/NodeJsMiddleware which has some code related to node building the SSR content.

Seeing as this issue is 2 years old, perhaps it can be closed or is no longer relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants