Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
samselikoff committed Jul 2, 2015
1 parent 56d10bc commit 42e089b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,26 @@ First, mount the admin interface in `routes.rb`:
```rb
Rails.application.routes.draw do

mount FrontEndBuilds::Engine, at: '/frontend-admin'
mount FrontEndBuilds::Engine, at: '/frontends'

end
```

You should mount this under an authenticated route using your application's
auth strategy, as anyone with access to the admin will be able to affect the
production builds of your front end apps.
production builds of your front end apps.a

If you don't want to set up an HTML auth strategy, you can do something like this:

```rb
# routes.rb
protected_app = Rack::Auth::Basic.new(FrontEndBuilds::Engine) do |username, password|
username == 'admin' && password == (Rails.env.production? ? ENV['FEB_ADMIN_PASSWORD'] : '')
end
mount protected_app, at: '/frontends'
```

This will use basic HTTP auth to secure access to your admin ui. Just set the ENV variable, and use it to gain access.

Now, to create a new app, first add a `front_end` route pointing to your app in `routes.rb`:

Expand Down

0 comments on commit 42e089b

Please sign in to comment.