Package io.micronaut.views.react
Interface ReactViewsRendererConfiguration
@ConfigurationProperties("micronaut.views.react")
public interface ReactViewsRendererConfiguration
An interface to the configuration properties for React server-side rendering.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default value forgetClientBundleURL()
.static final String
The default value forgetRenderScript()
.static final String
The default value forgetServerBundlePath()
.static final String
The config key prefix used to configure the React SSR view renderer. -
Method Summary
-
Field Details
-
PREFIX
The config key prefix used to configure the React SSR view renderer.- See Also:
-
DEFAULT_CLIENT_BUNDLE_URL
The default value forgetClientBundleURL()
.- See Also:
-
DEFAULT_SERVER_BUNDLE_PATH
The default value forgetServerBundlePath()
.- See Also:
-
DEFAULT_RENDER_SCRIPT
The default value forgetRenderScript()
.- See Also:
-
-
Method Details
-
getClientBundleURL
@NotBlank @NonNull @Bindable(defaultValue="/static/client.js") @NotBlank @NonNull String getClientBundleURL()- Returns:
- the URL (relative or absolute) where the client Javascript bundle can be found. It will be appended to the generated HTML in a <script> tag. Defaults to "/static/client.js"
-
getServerBundlePath
@NotBlank @NonNull @Bindable(defaultValue="classpath:views/ssr-components.mjs") @NotBlank @NonNull String getServerBundlePath()- Returns:
- the path relative to micronaut.views.folder where the bundle used for server-side rendering can be found. Defaults to "classpath:views/ssr-components.mjs"
-
getRenderScript
@NotBlank @NonNull @Bindable(defaultValue="classpath:/io/micronaut/views/react/react.js") @NotBlank @NonNull String getRenderScript()- Returns:
- Either a file path (starting with "file:" or a resource in the classpath (starting with "classpath:") to a render script. Please see the user guide for more information on what this Javascript file should contain.
-
getSandbox
@Bindable(defaultValue="false") boolean getSandbox()- Returns:
- If true, GraalJS sandboxing is enabled. This helps protect you against supply chain attacks that might inject code into your server via hijacked React components. It requires a sufficiently new version of GraalJS. Defaults to OFF.
-