mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
1aade36f13
* Add next/config * Set config on server start / client render * Add documentation for next/config * Add next/config support for next export * Fix test * Use the correct name * Set default to empty object on the client side * Add config tests * Rename config to runtimeConfig
9 lines
221 B
JavaScript
9 lines
221 B
JavaScript
// pages/index.js
|
|
import getConfig from 'next/config'
|
|
const config = getConfig()
|
|
|
|
export default () => <div>
|
|
<p id='server-only'>{config.mySecret}</p>
|
|
<p id='server-and-client'>{config.public.staticFolder}</p>
|
|
</div>
|