Yes, you can use Deepkit for server-side rendering of HTML templates. Deepkit supports rendering templates using JSX with full type safety. You can use the @deepkit/template
package to define and render HTML templates. Here is an example:
import { http, HtmlResponse, jsx } from '@deepkit/http'; class MyController { @http.GET('/') renderHomePage() { const name = 'John Doe'; return <h1>Hello, {name}!</h1>; } }
In this example, the jsx
function is used to create an HTML template using JSX syntax. The template is then rendered into an HtmlResponse
and returned from the controller action.