From 8b2c4a38a461ff5ecc95972291bc711e2c5dec9a Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 28 Apr 2023 01:47:57 +0800 Subject: --- examples/non-monorepo/pages/_app.tsx | 6 +++ examples/non-monorepo/pages/api/hello.ts | 13 ++++++ examples/non-monorepo/pages/index.tsx | 71 ++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 examples/non-monorepo/pages/_app.tsx create mode 100644 examples/non-monorepo/pages/api/hello.ts create mode 100644 examples/non-monorepo/pages/index.tsx (limited to 'examples/non-monorepo/pages') diff --git a/examples/non-monorepo/pages/_app.tsx b/examples/non-monorepo/pages/_app.tsx new file mode 100644 index 0000000..e6f7c5c --- /dev/null +++ b/examples/non-monorepo/pages/_app.tsx @@ -0,0 +1,6 @@ +import "../styles/globals.css"; +import type { AppProps } from "next/app"; + +export default function App({ Component, pageProps }: AppProps) { + return ; +} diff --git a/examples/non-monorepo/pages/api/hello.ts b/examples/non-monorepo/pages/api/hello.ts new file mode 100644 index 0000000..74a3605 --- /dev/null +++ b/examples/non-monorepo/pages/api/hello.ts @@ -0,0 +1,13 @@ +// 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 +) { + res.status(200).json({ name: "John Doe" }); +} diff --git a/examples/non-monorepo/pages/index.tsx b/examples/non-monorepo/pages/index.tsx new file mode 100644 index 0000000..4eb6c3d --- /dev/null +++ b/examples/non-monorepo/pages/index.tsx @@ -0,0 +1,71 @@ +import Head from "next/head"; +import Image from "next/image"; +import styles from "../styles/Home.module.css"; + +export default function Home() { + return ( +
+ + Create Next App + + + + +
+

+ Welcome to Next.js! +

+ +

+ Get started by editing{" "} + pages/index.tsx +

+ + +
+ + +
+ ); +} -- cgit v1.2.3-70-g09d2