F# clients for the node server apps
The node server app is started from the client library.
F# client and node server can run on Linux and Windows.
Example use cases for the client library:
- with F# Interactive in this script
- in a Jupyter Notebook app with this document using the new .net-fsharp kernel.
The server is configured via the following options
type ClientOptions =
{
/// path to node executable, default is "/usr/bin/node"
node: string
/// path of scriptfile, default is "../hafas-jsonrpc-server/build/index.js"
script: string
/// show transfer messages, default is false
verbose: bool }
The (de)serialization of F# types from/to JsonRpc messages is done with the following steps:
- byte -> string
- uses LowLevel and Client from FsAutoComplete
- string -> F# type
- uses FSharp.SystemTextJson and converters for erased union types.
The types are generated from
- the TypeScript declaration file hafas-client
- the TypeScript file railway-routes-types
with the following steps (see restore.sh):
- F# interface types with ts2fable
- F# interface types to record types with transformer.