Skip to content

Commit d4f8e69

Browse files
committed
Update
1 parent 77da63b commit d4f8e69

File tree

11 files changed

+16
-15
lines changed

11 files changed

+16
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Takes a `req`, `methods` and `options`. You can set options for an additional
1414
server argument or public error stacks.
1515

1616
```typescript
17-
import { serve } from "https://deno.land/std@0.88.0/http/server.ts"
17+
import { serve } from "https://deno.land/std@0.92.0/http/server.ts"
1818
import { respond } from "https://deno.land/x/gentle_rpc/mod.ts"
1919

2020
const server = serve("0.0.0.0:8000")

client/deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { generate } from "https://deno.land/std@0.88.0/uuid/v4.ts";
1+
export { generate } from "https://deno.land/std@0.92.0/uuid/v4.ts";

examples/example_deps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
export { serve } from "https://deno.land/std@0.88.0/http/server.ts";
1+
export { serve } from "https://deno.land/std@0.92.0/http/server.ts";
22
export { default as PressF } from "https://deno.land/x/pressf@0.2.0/pressf.ts";
33
export { respondWithFile } from "https://deno.land/x/pressf@0.2.0/middlewares/pressf-static/mod.ts";
4+
5+
export type { Context } from "https://deno.land/x/pressf@0.2.0/pressf.ts";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import { respond } from "../../mod.ts";
2+
import { Context } from "../example_deps.ts";
3+
14
export const rpcMethods = {
25
sayHello: (w: [string]) => `Hello ${w}`,
36
callNamedParameters: ({ a, b, c }: { a: number; b: number; c: string }) =>
47
`${c} ${a * b}`,
58
animalsMakeNoise: (noise: string[]) =>
69
noise.map((el) => el.toUpperCase()).join(" "),
710
};
11+
12+
export const respondRpc = (req: any) => respond(rpcMethods, req);

examples/rpc_and_file_server/server.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { respond as respondRpc } from "../../mod.ts";
2-
import { rpcMethods } from "./rpcMethods.ts";
1+
import { respondRpc } from "./rpc.ts";
32
import { PressF, respondWithFile } from "../example_deps.ts";
43

54
const proto = "http";
@@ -13,6 +12,6 @@ console.log(
1312
const app = new PressF();
1413

1514
app.get("*", respondWithFile(new URL(root, import.meta.url).pathname));
16-
app.post("*", (req) => respondRpc(rpcMethods, req));
15+
app.post("*", respondRpc);
1716

1817
await app.listen(port);

examples/ws/simpleClient.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { createRemote } from "../../mod.ts";
22

33
const remote = await createRemote(new WebSocket("ws://0.0.0.0:8000"));
4-
const remote2 = await createRemote(new WebSocket("ws://0.0.0.0:8000"));
54

6-
const noise2 = await remote.animalsMakeNoise(["wuufff"]).then(console.log)
7-
.catch(
8-
console.log,
9-
);
105
const noise = await remote.animalsMakeNoise(["wuufff"]).then(console.log).catch(
116
console.log,
127
);

server/deps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export {
22
acceptWebSocket,
33
isWebSocketCloseEvent,
4-
} from "https://deno.land/std@0.88.0/ws/mod.ts";
4+
} from "https://deno.land/std@0.92.0/ws/mod.ts";
55

6-
export type { WebSocket } from "https://deno.land/std@0.88.0/ws/mod.ts";
7-
export type { ServerRequest } from "https://deno.land/std@0.88.0/http/server.ts";
6+
export type { WebSocket } from "https://deno.land/std@0.92.0/ws/mod.ts";
7+
export type { ServerRequest } from "https://deno.land/std@0.92.0/http/server.ts";

0 commit comments

Comments
 (0)