@qonfucius/nuxt-headers

1.0.1 • Public • Published

Custom Nuxt Headers

Installation

Add this library in dependencies, then add it to nuxtJS modules

npm install @qonfucius/nuxt-headers
// nuxt.config.js
export default {
  modules: [
    '@qonfucius/nuxt-headers',
  ],
};

Usage

With this module you will be able to add custom headers in many ways :

  • Via serverHeaders, it will add to every request, via server middleware, including serving assets, favicon... You can access to req in parameters.
  • Via nuxtHeaders, it will add to every page access, via middleware. You can access to context in parameters.
  • In vue scripts, you can add a key httpHeaders, with same behavior than nuxtHeaders, but specific for a page.

Priority

Lowest in list is prior

  • All headers in config key httpHeaders.serverHeaders are set
  • All headers in config key httpHeaders.nuxtHeaders are set
  • All headers in module related configuration serverHeaders are set
  • All headers in module related configuration nuxtHeaders are set
  • All headers in vue file are set.

Special thanks

Readme

Keywords

Package Sidebar

Install

npm i @qonfucius/nuxt-headers

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

7.01 kB

Total Files

8

Last publish

Collaborators

  • rodrive
  • nainterceptor