feat: main
This commit is contained in:
parent
68c52422cf
commit
0816b3d980
@ -1,8 +1,8 @@
|
||||
import { renderToString } from "react-dom/server";
|
||||
import { RemixServer } from "remix";
|
||||
import type { EntryContext } from "remix";
|
||||
import { renderToString } from 'react-dom/server'
|
||||
import { RemixServer } from '@remix-run/react'
|
||||
import type { EntryContext } from '@remix-run/react/dist/entry'
|
||||
|
||||
export default function handleRequest(
|
||||
export default function handleRequest (
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
@ -10,12 +10,12 @@ export default function handleRequest(
|
||||
) {
|
||||
let markup = renderToString(
|
||||
<RemixServer context={remixContext} url={request.url} />
|
||||
);
|
||||
)
|
||||
|
||||
responseHeaders.set("Content-Type", "text/html");
|
||||
responseHeaders.set('Content-Type', 'text/html')
|
||||
|
||||
return new Response("<!DOCTYPE html>" + markup, {
|
||||
return new Response('<!DOCTYPE html>' + markup, {
|
||||
status: responseStatusCode,
|
||||
headers: responseHeaders
|
||||
});
|
||||
})
|
||||
}
|
||||
|
@ -1,30 +1,31 @@
|
||||
import { ChakraProvider } from "@chakra-ui/react"
|
||||
import type { MetaFunction } from "@vercel/remix"
|
||||
import { ChakraProvider } from '@chakra-ui/react'
|
||||
// import type { MetaFunction } from "@vercel/remix"
|
||||
import type { MetaFunction } from '@remix-run/node'
|
||||
import {
|
||||
Links,
|
||||
LiveReload,
|
||||
Meta,
|
||||
Outlet,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
} from "@remix-run/react"
|
||||
import { Analytics } from "@vercel/analytics/react"
|
||||
ScrollRestoration
|
||||
} from '@remix-run/react'
|
||||
import { Analytics } from '@vercel/analytics/react'
|
||||
|
||||
export const meta: MetaFunction = () => ({
|
||||
charset: "utf-8",
|
||||
title: "New Remix App",
|
||||
viewport: "width=device-width,initial-scale=1",
|
||||
charset: 'utf-8',
|
||||
title: 'New Remix App',
|
||||
viewport: 'width=device-width,initial-scale=1'
|
||||
})
|
||||
|
||||
function Document({
|
||||
function Document ({
|
||||
children,
|
||||
title = "App title",
|
||||
title = 'App title'
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
title?: string
|
||||
}) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<Meta />
|
||||
<title>{title}</title>
|
||||
@ -41,7 +42,7 @@ function Document({
|
||||
)
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
export default function App () {
|
||||
return (
|
||||
<Document>
|
||||
<ChakraProvider>
|
||||
|
Loading…
Reference in New Issue
Block a user