module.exports= {asyncheaders() {return [ { source:'/blog/:slug', headers: [ { key:'x-slug', value:':slug',// Matched parameters can be used in the value }, { key:'x-slug-:slug',// Matched parameters can be used in the key value:'my other custom header value', }, ], }, ] },}
module.exports= { i18n: { locales: ['en','fr','de'], defaultLocale:'en', },asyncheaders() {return [ { source:'/with-locale',// automatically handles all locales headers: [ { key:'x-hello', value:'world', }, ], }, {// does not handle locales automatically since locale: false is set source:'/nl/with-locale-manual', locale:false, headers: [ { key:'x-hello', value:'world', }, ], }, {// this matches '/' since `en` is the defaultLocale source:'/en', locale:false, headers: [ { key:'x-hello', value:'world', }, ], }, {// this gets converted to /(en|fr|de)/(.*) so will not match the top-level// `/` or `/fr` routes like /:path* would source:'/(.*)', headers: [ { key:'x-hello', value:'world', }, ], }, ] },}