Skip to content

Instantly share code, notes, and snippets.

@chrishunt
Last active December 16, 2015 00:28
Show Gist options
  • Save chrishunt/5347443 to your computer and use it in GitHub Desktop.
Save chrishunt/5347443 to your computer and use it in GitHub Desktop.

Revisions

  1. chrishunt revised this gist Apr 10, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Procfile
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,4 @@
    # Start fake service on port 3001
    # Add all your services here!

    # Start 'MyService' fake service on port 3001
    my_service: rackup --port 3001 my_service_config.ru
  2. chrishunt revised this gist Apr 9, 2013. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # Fake Service

    Don't want to start all your services? No problem! Make fake ones.

    Start all services in your `Procfile` with:

    ```bash
    $ bundle exec foreman start
    ```
  3. chrishunt revised this gist Apr 9, 2013. 2 changed files with 1 addition and 1 deletion.
    File renamed without changes.
    2 changes: 1 addition & 1 deletion my_service_config.ru
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    require './my_service/fake_server'
    require './fake_server'

    run Rack::URLMap.new \
    "/" => MyService::FakeServer
  4. chrishunt revised this gist Apr 9, 2013. 4 changed files with 23 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Gemfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    source 'https://rubygems.org'

    gem 'foreman'
    gem 'sinatra'
    2 changes: 2 additions & 0 deletions Procfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # Start fake service on port 3001
    my_service: rackup --port 3001 my_service_config.ru
    13 changes: 13 additions & 0 deletions my_service/fake_server.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    require 'sinatra'
    require 'json'

    module MyService
    class FakeServer < Sinatra::Base
    get '/' do
    {
    success: true,
    message: 'Hello World'
    }.to_json
    end
    end
    end
    4 changes: 4 additions & 0 deletions my_service_config.ru
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    require './my_service/fake_server'

    run Rack::URLMap.new \
    "/" => MyService::FakeServer
  5. chrishunt revised this gist Apr 9, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion placeholder
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    nothing.
  6. chrishunt created this gist Apr 9, 2013.
    1 change: 1 addition & 0 deletions placeholder
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    nothing.