Project

prelaunch

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Prelaunch allows you to restrict access to the Rails app while it is still in development.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

< 5, >= 3.2.6
 Project Readme

Prelaunch

Gem Version

Prelaunch allows you to restrict access to the Rails app while it is still in development. It supports Rails 3.2.6 and onwards (4 included).

Installation

Add Prelaunch to your Gemfile with:

gem 'prelaunch'

Run the bundle command to install it.

After you install prelaunch, generate routes and initializer with:

rails generate prelaunch

Take a second to ensure that prelaunch_routes is at the top of your routes table, like this:

Example::Application.routes.draw do
  prelaunch_routes
    
  ...

You can also take a look at config/initializers/prelaunch.rb to see configuration options.

If you want to customize placeholder page just do:

rails generate prelaunch:view

and edit app/views/prelaunch/index.html.

Usage

Immediately after installing gem your app in production environment for every route will show:

Under construction

To view contents of your app navigate to:

http://localhost:3000/prelaunch/letmein

After doing so you can continue to use your app normally.

You can configure path prefix prelaunch and token letmein in config/initializers/prelaunch.rb. You can also pass Array, Proc or lambda instead of String to config.token for more complex token verification.

To give user ability to end the session and logout add this piece of code to some view:

<%= prelaunch_logout_link 'Logout' %>

License

Prelaunch is released under the MIT License.