mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Added IronCache (not used yet).
Using copy of reverse proxy so can get error response.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
require 'rest'
|
||||
require 'sinatra'
|
||||
|
||||
# The backend would do this part before execute the worker
|
||||
########################################################
|
||||
rest = Rest::Client.new
|
||||
rest.logger.level = Logger::DEBUG
|
||||
|
||||
@@ -10,10 +12,9 @@ puts "public dns name: #{public_dns}"
|
||||
port = rand(50000..55000)
|
||||
puts "port: #{port}"
|
||||
|
||||
|
||||
response = rest.post(
|
||||
# "http://localhost:8080/",
|
||||
"http://router.irondns.info/",
|
||||
"http://router.irondns.info/?project_id=#{params[:project_id]}&token=#{params[:token]}",
|
||||
headers: {"Iron-Router"=>"YES!"},
|
||||
body: {"host"=>"routertest.irondns.info", "dest"=>"#{public_dns}:#{port}"})
|
||||
puts "body:"
|
||||
@@ -21,6 +22,9 @@ puts response.body
|
||||
|
||||
STDOUT.flush
|
||||
|
||||
# Now we start the actual worker
|
||||
##################################################################3
|
||||
|
||||
ENV['PORT'] = port.to_s # for sinatra
|
||||
my_app = Sinatra.new do
|
||||
set :port, port
|
||||
|
||||
Reference in New Issue
Block a user