Commit cfe748d4 authored by Tim Neutkens's avatar Tim Neutkens

Add note about getConfig

parent 9f4e7076
...@@ -1185,7 +1185,7 @@ module.exports = { ...@@ -1185,7 +1185,7 @@ module.exports = {
```js ```js
// pages/index.js // pages/index.js
import getConfig from 'next/config' 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(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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment