562b5a380e
Adds `next/navigation` and `next/headers` APIs. Docs will follow later.. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
19 lines
434 B
JavaScript
19 lines
434 B
JavaScript
import Nav from '../components/nav'
|
|
import { headers } from 'next/headers'
|
|
|
|
const envVar = process.env.ENV_VAR_TEST
|
|
const headerKey = 'x-next-test-client'
|
|
|
|
export default function Index() {
|
|
const headersList = headers()
|
|
const header = headersList.get(headerKey)
|
|
|
|
return (
|
|
<div>
|
|
<h1>{`component:index.server`}</h1>
|
|
<div>{'env:' + envVar}</div>
|
|
<div>{'header:' + header}</div>
|
|
<Nav />
|
|
</div>
|
|
)
|
|
}
|