Coder Social home page Coder Social logo

tonycthsu / stoplight-admin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bolshakov/stoplight-admin

0.0 1.0 0.0 53 KB

A simple administration interface for the stoplight gem.

Home Page: http://orgsync.github.io/stoplight-admin

License: MIT License

Dockerfile 1.99% Ruby 53.29% HTML 44.72%

stoplight-admin's Introduction

Stoplight Admin

Gem version Dependency status

A simple administration interface for stoplight. Monitor the status, failures, and invocations of your stoplights. Change stoplight colors, or lock them in either red or green state.

Configuration

This project is packaged as a Ruby gem so that you can easily embed it in your own code containing the configuration details for your stoplight data store.

First you'll need a Gemfile:

source 'https://rubygems.org'

gem 'stoplight-admin'

Run Bundler to install the dependencies:

$ bundle install

Lastly we need to make our (tiny) application. Here's a typical example using a local Redis data store:

# app.rb

require 'redis'
require 'sinatra'
require 'sinatra/stoplight_admin'

redis = Redis.new(url: 'redis://localhost:6379')
set :data_store, Stoplight::DataStore::Redis.new(redis)

Reverse Proxying

If you run Stoplight Admin behind a reverse proxy (nginx, for instance) at a URL other than root, you'll need to add the following lines to your app.rb file:

use Rack::Config do |env|
  env['SCRIPT_NAME'] = '/your/prefix/here'
end

Usage

$ bundle exec ruby app.rb

Rails

It is possible to mount Stoplight Admin inside Rails. Add something like this to your config/routes.rb:

require 'redis'
require 'sinatra/stoplight_admin'

class StoplightAdmin < Sinatra::Base
  register Sinatra::StoplightAdmin

  redis = Redis.new # Uses REDIS_URL environment variable.
  data_store = Stoplight::DataStore::Redis.new(redis)
  set :data_store, data_store
end

Rails.application.routes.draw do
  mount StoplightAdmin => '/stoplights'
end

Credits

Stoplight is brought to you by @camdez and @tfausak from @OrgSync.

stoplight-admin's People

Contributors

bschaeffer avatar camdez avatar mrdziuban avatar rogierslag avatar tfausak 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.