Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion 9 docs/recipes/client-server/fable-remoting.md
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
Member

Choose a reason for hiding this comment

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

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.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.