create remix project

This commit is contained in:
MapleLeaf
2021-12-29 11:41:24 -06:00
parent f3aab8f425
commit ec8dde942b
35 changed files with 5535 additions and 3001 deletions

16
docs/app/routes/index.tsx Normal file
View File

@@ -0,0 +1,16 @@
import { readFile } from "fs/promises"
import { json, LoaderFunction, useLoaderData } from "remix"
export const loader: LoaderFunction = async () => {
const docs = await readFile("app/docs.json", "utf8")
return json(JSON.parse(docs))
}
export default function Index() {
const data = useLoaderData()
return (
<main>
<pre>{JSON.stringify(data, undefined, 2)}</pre>
</main>
)
}