Rendering Service
A microservice for rendering HTML output from Handlebars templates part of the Restorecommerce.
Features
-
Rendering is performed using handlebars-helperized, a module which has several custom helpers for handlebars.
-
User defined helpers for handlebars are loaded from the handlebars folder on service startup.
-
Additionally, a stylesheet URL can be provided.
Events
Emitted
List of events emitted by this microservice for below topics:
Topic Name | Event Name | Description |
---|---|---|
|
|
emitted when request is rendered |
|
|
system health check response |
Consumed
This microservice consumes messages for the following events by topic:
Topic Name | Event Name | Description |
---|---|---|
|
|
to receive render request |
|
|
to get system health check |
Event Messages
RenderRequest
io.restorecommerce.rendering.RenderRequest
Field | Type | Label | Description |
---|---|---|---|
id |
string |
required |
Request ID |
payloads |
[ ] |
required |
List of templates and data |
io.restorecommerce.rendering.Payload
Field | Type | Label | Description |
---|---|---|---|
templates |
string |
required |
JSON mapping labels to body and layout templates |
data |
string |
required |
JSON mapping content to render output |
style_url |
string |
optional |
A URL pointing to a stylesheet |
strategy |
enum |
optional |
Strategy to use for applying the stylesheet. Possible values are |
options |
|
optional |
Additional options passed as JSON (for ex: translation texts included) |
content_type |
string |
required |
content type for rendering ex: 'application/html' or 'application/text' |