import { Router } from '@stricjs/router';
import { html } from '@stricjs/utils';
const page = `<html>
<body>
<h1>Hi</h1>
<body>
</html>`;
export default new Router()
.get('/', () => html(page));
import { Router } from '@stricjs/router';
import { createHTML } from '@stricjs/utils';
const html = createHTML({ status: 404 });
const page = `<html>
<body>
<h1>Page not found</h1>
<body>
</html>`;
export default new Router()
.get('/404', () => html(page));
You can set the HTML content you want to send as well.
import { Router } from '@stricjs/router';
import { createHTML } from '@stricjs/utils';
// Call this with no args
const html = createHTML({ status: 404 }, `<html>
<body>
<h1>Page not found</h1>
<body>
</html>`);
export default new Router()
.get('/404', html);