feat: tmp added entry.X.tsx files

This commit is contained in:
Nikolaj Frey 2023-06-27 10:23:58 +10:00
parent 9f0d7ad69e
commit 616ac03b47
3 changed files with 32 additions and 0 deletions

4
app/app/entry.client.tsx Normal file
View File

@ -0,0 +1,4 @@
import { hydrate } from 'react-dom'
// import { RemixBrowser } from "remix";
import { RemixBrowser } from '@remix-run/react'
hydrate(<RemixBrowser />, document)

21
app/app/entry.server.tsx Normal file
View File

@ -0,0 +1,21 @@
import { renderToString } from "react-dom/server";
import { RemixServer } from "remix";
import type { EntryContext } from "remix";
export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
) {
let markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
);
responseHeaders.set("Content-Type", "text/html");
return new Response("<!DOCTYPE html>" + markup, {
status: responseStatusCode,
headers: responseHeaders
});
}

7
app/vercel.json Normal file
View File

@ -0,0 +1,7 @@
{
"build": {
"env": {
"ENABLE_FILE_SYSTEM_API": "1"
}
}
}