Coder Social home page Coder Social logo

heroku-nav's Introduction

Heroku Nav

Codeship Status for codeship/heroku-nav

This is a Ruby gem providing a Rack middleware to help Heroku add-on providers displaying a customized header for users coming from a single sign-on session.

Usage

Use it just like any Rack middleware:

require 'heroku/nav'
use Heroku::Nav::Provider

That will fetch the latest header from our API and insert it as the first element inside the body tag when the cookie "heroku-nav-data" is defined.

For Rails apps, add it to your Gemfile:

gem 'heroku-nav', :require => 'heroku/nav'

And add the middleware like:

config.middleware.use Heroku::Nav::Provider

By default the header will be inserted only in responses with status 200. You can insert it in responses with different status codes with the :status config param:

config.middleware.use Heroku::Nav::Provider, :status => [200, 404]

To don't display the header on a given request path you can use the :except config param:

config.middleware.use Heroku::Nav::Provider, :except => /admin/

Meta

Written by Pedro Belo, with contributions from:

  • Todd Matthews
  • David Dollar
  • Caio Chassot
  • Raul Murciano
  • Jonathan Dance

Released under the MIT license. http://github.com/heroku/heroku-nav

heroku-nav's People

Contributors

wuputah avatar alextacho avatar raul avatar bscofield avatar jodosha avatar kch avatar ddollar avatar seaofclouds avatar beanieboi avatar clemenshelm avatar

Watchers

rosa maria palacios juncosa avatar  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.