mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-11-01 22:22:33 +01:00
init
This commit is contained in:
20
app/tutorials/[tutorial]/page.tsx
Normal file
20
app/tutorials/[tutorial]/page.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { marked } from "marked";
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: { tutorial: string };
|
||||
}) {
|
||||
const requestData = await fetch(`http://127.0.0.1:3000/test.json`, {
|
||||
cache: "no-store", //! Just for dev
|
||||
/*next: { revalidate: 10 }*/
|
||||
});
|
||||
const data = await requestData.json();
|
||||
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked.parse(data.markdown) ?? "",
|
||||
}}
|
||||
></div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user