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