FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update `fable-remoting.md` by aplikethewatch · Pull Request #366 · SAFE-Stack/docs · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 8 additions & 1 deletion docs/recipes/client-server/fable-remoting.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ let myApi =
|> Remoting.buildProxy<IMyApi>
```

> 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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would remove the above sample - there's no need for both. Or at the very least, put the preferred way (Api.makeProxy) first.

> ```fsharp
> open SAFE
>
> let myApi = Api.makeProxy<IMyApi> ()
> ```

#### 7. Make calls to the Server
Replace the following two lines in the `init` function in `Client.fs`:

Expand All @@ -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.
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.

Back | FazBrowse Home | New Git URL