Questions & Answers

How can I return HTML responses?

Deepkit HTTP
50 up-votes
Warning: The answer is generated by an artificial intelligence. It might not be correct.
To adjust rating, open the thread in Discord and click on the up/down vote button.

To return HTML responses, you can use the HtmlResponse class or simply return a string of HTML content.

Using the HtmlResponse class:

import { HtmlResponse } from '@deepkit/http';

router.get('/', () => {
  return new HtmlResponse('<h1>Hello World</h1>');
});