This commit is contained in:
10
examples/next-with-pages/src/pages/_app.tsx
Normal file
10
examples/next-with-pages/src/pages/_app.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { AptabaseProvider } from '@aptabase/react';
|
||||
import type { AppProps } from 'next/app';
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<AptabaseProvider appKey="A-DEV-0000000000">
|
||||
<Component {...pageProps} />
|
||||
</AptabaseProvider>
|
||||
);
|
||||
}
|
||||
13
examples/next-with-pages/src/pages/_document.tsx
Normal file
13
examples/next-with-pages/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>
|
||||
)
|
||||
}
|
||||
9
examples/next-with-pages/src/pages/api/hello.ts
Normal file
9
examples/next-with-pages/src/pages/api/hello.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
|
||||
type Data = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
|
||||
res.status(200).json({ name: 'John Doe' });
|
||||
}
|
||||
23
examples/next-with-pages/src/pages/index.tsx
Normal file
23
examples/next-with-pages/src/pages/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Counter } from '@/components/Counter';
|
||||
import { GetServerSideProps } from 'next';
|
||||
import Head from 'next/head';
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async ({ req }) => {
|
||||
return { props: {} };
|
||||
};
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Create Next App</title>
|
||||
<meta name="description" content="Generated by create next app" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</Head>
|
||||
<main>
|
||||
Aptabase + Next.js Pages Router <br />
|
||||
<Counter />
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user