Giter Club home page Giter Club logo

nuxt-maintenance-mode's Introduction

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!

nuxt-maintenance-mode's People

Contributors

renovate[bot] avatar potato4d avatar renovate-bot avatar joaopedroas51 avatar allcontributors[bot] avatar matsava avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.