Git Product home page Git Product logo

rack-maintenance's Introduction

rack-maintenance

Rack::Maintenance is a simple Rack middleware to detect the existence of a maintenance page and display that instead of incoming requests.

<img src=“https://www.codeship.io/projects/740db0a0-1a2c-0132-42f9-66434e25f59b/status” />

Installation

sudo gem install rack-maintenance

Installation with Bundler

In Gemfile:

gem 'rack-maintenance'

and then run ‘bundle`.

Usage

# html maintenance response
config.middleware.use 'Rack::Maintenance',
  :file => Rails.root.join('public', 'maintenance.html'),
  :env  => 'MAINTENANCE'

# json maintenance response
# it's up to you to provide a valid JSON file!
config.middleware.use 'Rack::Maintenance',
  :file => Rails.root.join('public', 'maintenance.json'),
  :env  => 'MAINTENANCE'

If :env is specified, all requests will be shown the maintenance page if the environment variable is set.

If :env is not specified, the maintenance page will be shown if it exists.

# Leave some paths enabled while site is down
# You'll usually want to exclude /assets if you'd like to retain CSS.
# It also works for allowing access to admin while the rest is in maintenance mode.
config.middleware.use 'Rack::Maintenance',
  :file => Rails.root.join('public', 'maintenance.html'),
  :without => /\A\/assets/

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix in a branch.

  • Add tests for it.

  • Commit, do not mess with Rakefile or VERSION (do that in a separate commit if you want a local version)

  • Push your branch.

  • Send me a pull request.

Space Babies

We create internet. www.spacebabies.nl

License

BSD. See LICENSE for details.

rack-maintenance's People

Contributors

ddollar avatar hybridknight avatar serixscorpio avatar tilsammans avatar

Watchers

 avatar  avatar

Forkers

skilllane

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.