import { renderToStaticMarkup, renderToString } from 'react-dom/server';
import express from 'express';
import { createStylesServer, ServerStyles } from '@mantine/ssr';
import { App } from './App';
import { Html } from './Html';
const stylesServer = createStylesServer();
app.use('*', (req, res) => {
const content = renderToString(<App />);
const html = renderToStaticMarkup(
<Html styles={<ServerStyles html={content} server={stylesServer} />}>{content}</Html>
res.send(`<!doctype html>\n${html}`);