From c4e5cec4be38cda02e2d48f4c61f30fa6973c3aa Mon Sep 17 00:00:00 2001 From: Amir Panahi <78684494+amirrezapanahi@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:44:17 +0100 Subject: [PATCH] Update fable-remoting.md to accomodate features from safe server metapackage --- docs/recipes/client-server/fable-remoting.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/recipes/client-server/fable-remoting.md b/docs/recipes/client-server/fable-remoting.md index b0495edb9..c72e8861f 100644 --- a/docs/recipes/client-server/fable-remoting.md +++ b/docs/recipes/client-server/fable-remoting.md @@ -59,6 +59,13 @@ let myApi = |> Remoting.buildProxy ``` +> Note: We have made your life easier by creating Metapackages which abstract some of this boilerplate. You can also create the client proxy like so: +> ```fsharp +> open SAFE +> +> let myApi = Api.makeProxy () +> ``` + #### 7. Make calls to the Server Replace the following two lines in the `init` function in `Client.fs`: @@ -74,4 +81,4 @@ let cmd = Cmd.OfAsync.perform myApi.hello () GotHello ``` ## Done! -At this point, the app should work just as it did before. Now, expanding the API and adding a new endpoint is as easy as adding a new field to the API protocol we defined in `Shared.fs`, editing the `myApi` record in `Server.fs` with the implementation, and finally making calls from the proxy. \ No newline at end of file +At this point, the app should work just as it did before. Now, expanding the API and adding a new endpoint is as easy as adding a new field to the API protocol we defined in `Shared.fs`, editing the `myApi` record in `Server.fs` with the implementation, and finally making calls from the proxy.