Rendering HTML

Rendering HTML

You can use the

to return HTML pages. You can copy the URL by using the menu and selecting Endpoints > Copy web endpoint.

Click on this URL to view the above Val:

Using Markdown

By importing a markdown library like Marked, you can render markdown to HTML.

View the result by clicking on this URL:

React With Server-Side Rendering (SSR)

You can import ReactDOMServer from the react-dom/server module to perform server-side rendering with React.

Note: JSX is not supported yet.

ReactDOMServer.renderToString converts the TodoList component into HTML which is sent to the client as the initial server response, which you can view here: