Skip to content

Commit

Permalink
added chart data route
Browse files Browse the repository at this point in the history
  • Loading branch information
msarilar committed Jul 10, 2018
1 parent a2ada8e commit 57db098
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions EDEngineer.Server/CommanderChart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ open Newtonsoft.Json
open EDEngineer.Models.Utils
open EDEngineer.Models
open EDEngineer.Models.Operations
open EDEngineer.Models.State
open NodaTime
open XPlot.Plotly
open System
open System.Collections.Generic
Expand Down
12 changes: 12 additions & 0 deletions EDEngineer.Server/Server.fs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,18 @@ let start (token,
return result |> OK
})))

GET >=> pathScan "/%s/chartData%s" (fun (commander, format) ->
(request(fun request ->
cmdr {
let! state = stateRoute commander
let! f = FormatExtractor request format
let! l = LanguageExtractor <| request.queryParam "lang"
let settings = jsonSettingsGetter.Invoke(commander)

let result = CommanderChart.chartData commander logDirectory settings translator l
return (result, l) |> FormatPicker(f) |> OK >=> MimeType(f)
})))

OPTIONS >=>
fun context ->
context |> (
Expand Down

0 comments on commit 57db098

Please sign in to comment.