Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let res = await fetch(`${process.env.SERVER_URL}/api/category/initialCategoryMeta?category=${category}`
- // next.config.js
- module.exports = {
- serverRuntimeConfig: {
- // Will only be available on the server side
- mySecret: 'secret',
- secondSecret: process.env.SECOND_SECRET, // Pass through env variables
- },
- publicRuntimeConfig: {
- // Will be available on both server and client
- staticFolder: '/static',
- },
- }
- // pages/index.js
- import getConfig from 'next/config'
- // Only holds serverRuntimeConfig and publicRuntimeConfig from next.config.js nothing else.
- const { serverRuntimeConfig, publicRuntimeConfig } = getConfig()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement