1
0
Fork 0
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:
Tim Neutkens 2018-03-29 10:17:44 +02:00
parent 9f4e707682
commit cfe748d4b5

View file

@ -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