This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run from command line. | |
docker rm $(docker ps -q -f status=exited) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext/hash/conversions' | |
require 'sinatra' | |
require 'json' | |
CONTENT_TYPES={'xml' => 'text/xml','json' => 'application/json'} | |
get '/api/v1/patients/?' do | |
{:errid => 'R1',:errdesc => 'Patient List Retrieved.',:payload => ['A','B','C','D','E','F']}.to_json | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PatientsController : ApiController { | |
// GET api/patients | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1", "value2" }; | |
} | |
// GET api/patients/5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This all works as long as the connection stays up. I can have multiple clients all getting the same value from the published channel | |
# simultaneously. However, as soon as any client disconnects or times out, then the stream is marked as "closed" and everything comes | |
# falling down. | |
require 'bundler/setup' | |
require 'sinatra/base' | |
require 'sinatra/streaming' | |
require 'sinatra/synchrony' | |
require 'em-hiredis' |