Skip to content

Commit

Permalink
Add a non TDS version (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannParis authored Jul 3, 2024
1 parent d8d06f8 commit b185ddd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/SimulationService.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function start!(; host=HOST[], port=PORT[], kw...)


Oxygen.@get "/model-equation/{id}" modelEquation
Oxygen.@post "/model-equation" modelToEquation

Oxygen.@get "/health" health
Oxygen.@get "/status/{id}" job_status
Expand Down Expand Up @@ -232,6 +233,16 @@ function modelEquation(::HTTP.Request, id::String)
])
end

# POST /model-equation
function modelToEquation(req::HTTP.Request)
amrJSON = JSON3.read(req.body)
sys = amr_get(amrJSON, ODESystem)
model_latex = latexify(sys)
return Dict([
(:latex, model_latex.s)
])
end


#-----------------------------------------------------------------------------# health: GET /
function health(::HTTP.Request)
Expand Down

0 comments on commit b185ddd

Please sign in to comment.