diff --git a/pages/_app.tsx b/pages/_app.tsx deleted file mode 100644 index 945e892..0000000 --- a/pages/_app.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import '../styles/globals.css' -import type { AppProps } from 'next/app' - -function MyApp({ Component, pageProps }: AppProps) { - return -} -export default MyApp diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx new file mode 100644 index 0000000..c78609b --- /dev/null +++ b/src/pages/_app.tsx @@ -0,0 +1,7 @@ +import "styles/globals.css"; +import type { AppProps } from "next/app"; + +function MyApp({ Component, pageProps }: AppProps) { + return ; +} +export default MyApp; diff --git a/pages/api/hello.ts b/src/pages/api/hello.ts similarity index 59% rename from pages/api/hello.ts rename to src/pages/api/hello.ts index f8bcc7e..74a3605 100644 --- a/pages/api/hello.ts +++ b/src/pages/api/hello.ts @@ -1,13 +1,13 @@ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' +import type { NextApiRequest, NextApiResponse } from "next"; type Data = { - name: string -} + name: string; +}; export default function handler( req: NextApiRequest, res: NextApiResponse ) { - res.status(200).json({ name: 'John Doe' }) + res.status(200).json({ name: "John Doe" }); } diff --git a/pages/index.tsx b/src/pages/index.tsx similarity index 88% rename from pages/index.tsx rename to src/pages/index.tsx index 08145bb..36f9c21 100644 --- a/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,8 +1,11 @@ -import Head from 'next/head' -import Image from 'next/image' -import styles from '../styles/Home.module.css' +import Head from "next/head"; +import Image from "next/image"; +import styles from "styles/Home.module.css"; +import { useEffect, useState } from "react"; export default function Home() { + const [state, setState] = useState(0); + return (
@@ -17,7 +20,7 @@ export default function Home() {

- Get started by editing{' '} + Get started by editing{" "} pages/index.js

@@ -58,12 +61,12 @@ export default function Home() { target="_blank" rel="noopener noreferrer" > - Powered by{' '} + Powered by{" "} Vercel Logo
- ) + ); } diff --git a/styles/Home.module.css b/src/styles/Home.module.css similarity index 100% rename from styles/Home.module.css rename to src/styles/Home.module.css diff --git a/styles/globals.css b/src/styles/globals.css similarity index 100% rename from styles/globals.css rename to src/styles/globals.css diff --git a/tsconfig.json b/tsconfig.json index 4fa631c..c56ba55 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,8 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve" + "jsx": "preserve", + "baseUrl": "./src" }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"]