Skip to content

Commit

Permalink
docs: comments for using existing server
Browse files Browse the repository at this point in the history
  • Loading branch information
Vehmloewff committed Dec 19, 2020
1 parent a08a32a commit a0e454a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const app = createJsonrpcServer()

app.method('greet', ({ name }) => `Hello, ${name}!`)

app.listen({ port: 3000 }) // You can use `app.oakMiddleware()` or `app.addToHttpServer(server)` to use an existing server.

// Client
import { connect } from 'https://denopkg.com/Vehmloewff/jsonrpc/client.ts'

Expand All @@ -22,11 +24,6 @@ await connection.call('greet', { name: 'Vehmloewff' }) // -> Hello, Vehmloewff!

There is a more complete example in the [test](/test) folder.

## Docs

- [Server](https://doc.deno.land/https/denopkg.com/Vehmloewff/jsonrpc/server.ts)
- [Client](https://doc.deno.land/https/denopkg.com/Vehmloewff/jsonrpc/client.ts)

## Contributing

Of course!
Expand Down

0 comments on commit a0e454a

Please sign in to comment.