switch to next.js
- init next app - add daisyUI
This commit is contained in:
6
client/src/pages/_app.tsx
Normal file
6
client/src/pages/_app.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import "@/styles/globals.css";
|
||||
import type { AppProps } from "next/app";
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return <Component {...pageProps} />;
|
||||
}
|
||||
13
client/src/pages/_document.tsx
Normal file
13
client/src/pages/_document.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Html, Head, Main, NextScript } from "next/document";
|
||||
|
||||
export default function Document() {
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head />
|
||||
<body>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</Html>
|
||||
);
|
||||
}
|
||||
10
client/src/pages/api/hello.ts
Normal file
10
client/src/pages/api/hello.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
type Data = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export default function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
|
||||
res.status(200).json({ name: "John Doe" });
|
||||
}
|
||||
5
client/src/pages/index.tsx
Normal file
5
client/src/pages/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
const index = () => {
|
||||
return <div>index</div>;
|
||||
};
|
||||
|
||||
export default index;
|
||||
Reference in New Issue
Block a user