chore: add home page with information on local API

This commit is contained in:
Paul Popus
2024-03-09 13:50:13 -03:00
parent 373b4c0a4c
commit 2ba9a84825
5 changed files with 124 additions and 2 deletions

54
src/app/(app)/page.tsx Normal file
View File

@ -0,0 +1,54 @@
import Example from '@/components/Example'
import Link from 'next/link'
import React from 'react'
const Page = () => {
return (
<article className={['container'].filter(Boolean).join(' ')}>
<h1>
Payload 3.0 <span className='rainbow'>ALPHA</span>!
</h1>
<p>
This alpha is rapidly evolving, you can report any bugs against{' '}
<a href='https://github.com/payloadcms/payload-3.0-alpha-demo/issues' target='_blank'>
the repo
</a>{' '}
or in the{' '}
<a href='https://discord.com/channels/967097582721572934/1215659716538273832' target='_blank'>
dedicated channel in Discord
</a>
.
</p>
<p>
<strong>
Payload is running at <Link href='/admin'>/admin</Link>
</strong>
</p>
<p>
<Link href='/my-route' target='_blank'>
/my-route
</Link>{' '}
contains an example of a custom route running the Local API.
</p>
{/* Commented out for now due to bug */}
{/* <Example /> */}
<p>You can use the Local API in your server components like this:</p>
<pre>
<code>
{`import { getPayload } from 'payload'
const payload = await getPayload()
const data = await payload.find({
collection: 'posts',
})`}
</code>
</pre>
</article>
)
}
export default Page