Skip to content

Files

Latest commit

75c6a8f · Sep 2, 2021

History

History

assembler

Knot.x Fragments Assembler

This module contains Handler that joins all Fragments and saves the result into the ClientResponse body.

How does it work?

Fragment Assembler reads Fragments from the RoutingContext under "fragments" key and joins them all into one string, saving as the Client Response body.

How Fragments are being joined?

Lets explain the process of fragments joining fragments using an example.

Fragment Assembler reads ClientRequest that contains three Fragments:

<html>
<head>
  <title>Test</title>
</head>
<body>
<h1>test</h1>
  <h2>this is webservice no. 1</h2>
  <div>message - a</div>
</body>
</html>

Fragment Assembler joins all those Fragments into one string:

<html>
<head>
  <title>Test</title>
</head>
<body>
<h1>test</h1>
  <h2>this is webservice no. 1</h2>
  <div>message - a</div>
</body>
</html>