mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add note about getConfig
This commit is contained in:
parent
9f4e707682
commit
cfe748d4b5
|
@ -1185,7 +1185,7 @@ module.exports = {
|
|||
```js
|
||||
// pages/index.js
|
||||
import getConfig from 'next/config'
|
||||
const {serverRuntimeConfig, publicRuntimeConfig} = getConfig()
|
||||
const {serverRuntimeConfig, publicRuntimeConfig} = getConfig() // Only holds serverRuntimeConfig and publicRuntimeConfig from next.config.js nothing else.
|
||||
|
||||
console.log(serverRuntimeConfig.mySecret) // Will only be available on the server side
|
||||
console.log(publicRuntimeConfig.staticFolder) // Will be available on both server and client
|
||||
|
|
Loading…
Reference in a new issue