Skip to content
Maintenance mode module for Nuxt.js.
TypeScript Vue JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci chore(deps): update node.js to v10.17.0 (#77) Oct 24, 2019
src
test/fixture styles: Update error sample design Jan 28, 2019
.all-contributorsrc docs: add chrysanthos as a contributor (#32) Apr 4, 2019
.gitignore types: Migrate to TypeScript Jan 27, 2019
.npmignore
.prettierignore chore: Update prettier config Jan 27, 2019
.prettierrc
CHANGELOG.md
LICENSE doc: Update LICENSE Jan 27, 2019
README.md Update README.md Aug 18, 2019
package.json Merge pull request #87 from potato4d/renovate/prettier-1.x Nov 9, 2019
renovate.json
tsconfig.json
yarn.lock fix(middleware): fix matcher path (#54) Aug 17, 2019

README.md

Maintenance mode module for Nuxt.js

codecov All Contributors NPM version NPM downloads CircleCI

A module for displaying the view for maintenance as fallback while maintaining the path.

Image from Gyazo

About this module

A module for displaying the view for maintenance as fallback while maintaining the path.

Instead of accessed routing, render the contents of the routing specified for maintenance and return status code 503 to the client.

This is the easiest and most effective way to put an application in maintenance state without compromising the SEO and the user's access experience.

Caution

This project is under development.

We welcome aggressive pull requests such as when there is a better implementation.

Installation

At first, install package from NPM

$ yarn add nuxt-maintenance-mode # or npm i -S

Next, Add 'nuxt-maintenance-mode' value to modules property in nuxt.config.js

module.exports = {
  // ...
  modules: ['nuxt-maintenance-mode']
  // ...
}

Last, Add maintenance mode options to nuxt.config.js

module.exports = {
  // ...
  modules: [
    'nuxt-maintenance-mode'
  ],
  maintenance: {
    enabled: !!process.env.MAINTENANCE_MODE, // If given truthy value, activation maintenance mode on startup your nuxt application.
    path: '/maintenance', // maintenance fallback content routing.
    matcher: /^\/admin/ // Path to be in maintenance mode (regex).
  },
  // ...
}

Options

enabled?: boolean

  • default: false
  • required: false

If given truthy value, activation maintenance mode on startup your nuxt application.

We recommend specifying the value of the environment variable.

path: string

  • default: undefined
  • required: true

maintenance fallback content routing.

The path you set for this property must have a valid routing.

For example, if you specify /maintenance, create pages/maintenance.vue.

matcher?: string

  • default: undefined
  • required: false

Path to be in maintenance mode (regex).

LICENSE

MIT (c) HANATANI Takuma(@potato4d)

Contributors

Thanks goes to these wonderful people (emoji key):

Takuma HANATANI
Takuma HANATANI

💻 🚧 📖 🐛
Chrysanthos
Chrysanthos

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

You can’t perform that action at this time.