feat: tmp added entry.X.tsx files
This commit is contained in:
parent
9f0d7ad69e
commit
616ac03b47
4
app/app/entry.client.tsx
Normal file
4
app/app/entry.client.tsx
Normal 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
21
app/app/entry.server.tsx
Normal 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
7
app/vercel.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"env": {
|
||||||
|
"ENABLE_FILE_SYSTEM_API": "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user