tried sub-sub router

This commit is contained in:
Travis
2013-01-26 17:01:47 -08:00
parent a6ae9f2db7
commit c05e61e588
2 changed files with 5 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ func main() {
common.SetLogLevel(config.Logging.Level)
common.SetLogLocation(config.Logging.To, config.Logging.Prefix)
golog.Infoln("Starting up router v", version)
golog.Infoln("Starting up router version", version)
runtime.GOMAXPROCS(runtime.NumCPU())
log.Println("Running on", runtime.NumCPU(), "CPUs")
@@ -115,7 +115,7 @@ func main() {
s.Handle("/addworker", &WorkerHandler{})
s.HandleFunc("/", Ping)
s2 := r.Headers("Iron-Router", "").Subrouter()
s2 := s.Headers("Iron-Router", "").Subrouter()
s2.Handle("/", &WorkerHandler{})
r.HandleFunc("/ping", Ping) // for ELB health check

View File

@@ -16,9 +16,10 @@ project_id = params[:project_id] || "4fd2729368a0197d1102056b" # // this is my D
token = params[:token] || "MWx0VfngzsCu0W8NAYw7S2lNrgo"
code_name = params[:code_name] || "sinatra"
query = "?project_id=#{project_id}&token=#{token}&code_name=#{code_name}"
response = rest.post(
# "http://localhost:8080/",
"http://router.irondns.info/?project_id=#{project_id}&token=#{token}&code_name=#{code_name}",
# "http://localhost:80/#{query}",
"http://router.irondns.info/#{query}",
headers: {"Iron-Router"=>"YES!", "Content-Type"=>"application/json"},
body: {"host"=>"routertest.irondns.info", "dest"=>"#{public_dns}:#{port}"})
puts "body:"