Rendering Service

Build Status Dependencies Cover

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

io.restorecommerce.rendering

renderResponse

emitted when request is rendered

io.restorecommerce.command

healthCheckResponse

system health check response

Consumed

This microservice consumes messages for the following events by topic:

Topic Name Event Name Description

io.restorecommerce.rendering

renderRequest

to receive render request

io.restorecommerce.command

healthCheckCommand

to get system health check

Event Messages

RenderRequest

io.restorecommerce.rendering.RenderRequest

Field Type Label Description

id

string

required

Request ID

payloads

[ ] io.restorecommerce.rendering.Payload

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 INLINE and COPY

options

google.protobuf.Any

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'

RenderResponse

io.restorecommerce.rendering.RenderResponse

Field Type Label Description

id

string

required

Same value as the respective RenderRequest id

responses

[ ] google.protobuf.Any

required

List of rendered outputs