# HTML generation via test server in JavaScript

Test server handlers can also send HTML code:

`export default { '/test/': function() { return '<b>text</b>'; } }`

You can also generate HTML code in a loop:

`export default { '/test/': function() { let str = '<ul>'; for (let i = 1; i < 9; i ++) { str += '<li>' + i + '</li>'; } str += '</ul>'; return str; } }`

Let an array be given on the server:

`let arr = [1, 2, 3, 4, 5];`

Make a route that writes each element of the array into its own paragraph and sends the result to the server.

←→
↑
en ru