Skip to content

Commit

Permalink
Change localhost to Docker internal URL for API testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Becker committed Feb 3, 2025
1 parent dc2b21a commit 35d80d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/reopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,6 @@ function run_reopt(m::JuMP.AbstractModel, p::REoptInputs; organize_pvs=true)
"name" => p.s.settings.name,
"latitude" => p.s.site.latitude,
"longitude" => p.s.site.longitude,
"country" => "",
"city" => "",
"pv_size" => get(get(results, "PV", Dict()), "size_kw", nothing),
"battery_energy_size" => get(get(results, "ElectricStorage", Dict()), "size_kwh", nothing),
"battery_power_size" => get(get(results, "ElectricStorage", Dict()), "size_kw", nothing)
Expand All @@ -610,8 +608,10 @@ function run_reopt(m::JuMP.AbstractModel, p::REoptInputs; organize_pvs=true)
"status" => results["status"]
)

print("track_data dict to reopt-track API = ", track_data)
headers = Dict("Content-Type" => "application/json")
HTTP.post("http://localhost:7800/reopt/post/", headers, JSON.json(track_data))
# HTTP.post("http://localhost:7800/reopt/post/", headers, JSON.json(track_data))
HTTP.post("http://host.docker.internal:7800/reopt/post/", headers, JSON.json(track_data))
# catch #e
# @warn "Could not post tracking data to REopt API"
# #@info e.message
Expand Down

0 comments on commit 35d80d4

Please sign in to comment.