next.config.js #Route #env_appName

PHOTO EMBED

Sat Jan 15 2022 18:27:00 GMT+0000 (UTC)

Saved by @GodFather #javascript

module.exports = {
  reactStrictMode: true,

  //global title
  env: {
    appName: 'yusup.com',
  },
  
  //Route
  async rewrites() { 
    return [
      {
        source: '/login', //link
        destination: '/auth/login', //Lokasi File
      },
      {
        source: '/register',
        destination: '/auth/register',
      }
    ]
  }
}

//Pemakaian global title
<Layout title={process.env.appName}> //Tanpa di import
  <div></div>
</Layout
content_copyCOPY