Skip to content

Commit ac43e6c

Browse files
committed
Use .endpoint() in the examples/
1 parent ffce6ee commit ac43e6c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/example.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type counterApiType = typeof counter;
6161
// restate server
6262

6363
restate
64-
.createServer()
64+
.endpoint()
6565
.bindRouter("greeter", greeter)
6666
.bindKeyedRouter("counter", counter)
6767
.listen(9080);

examples/grpc_example.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class GreeterService implements TestGreeter {
4545
}
4646

4747
restate
48-
.createServer()
48+
.endpoint()
4949
.bindService({
5050
descriptor: protoMetadata,
5151
service: "TestGreeter",

examples/handler_example.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ type UserProfile = {
2424

2525
const profileService = restate.keyedRouter({
2626
registration: restate.keyedEventHandler(
27-
async (ctx: restate.RpcContext, event: restate.Event) => {
27+
async (ctx: restate.KeyedContext, event: restate.Event) => {
2828
// store in state the user's information as coming from the registeration event
2929
const { name } = event.json<{ name: string }>();
3030
ctx.set("name", name);
3131
}
3232
),
3333

3434
email: restate.keyedEventHandler(
35-
async (ctx: restate.RpcContext, event: restate.Event) => {
35+
async (ctx: restate.KeyedContext, event: restate.Event) => {
3636
// store in state the user's information as coming from the email event
3737
const { email } = event.json<{ email: string }>();
3838
ctx.set("email", email);
3939
}
4040
),
4141

42-
get: async (ctx: restate.RpcContext, id: string): Promise<UserProfile> => {
42+
get: async (ctx: restate.KeyedContext, id: string): Promise<UserProfile> => {
4343
return {
4444
id,
4545
name: (await ctx.get<string>("name")) ?? "",
@@ -49,4 +49,4 @@ const profileService = restate.keyedRouter({
4949
});
5050

5151
// restate server
52-
restate.createServer().bindKeyedRouter("profile", profileService).listen(9080);
52+
restate.endpoint().bindKeyedRouter("profile", profileService).listen(9080);

examples/workflow_example.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const myworkflow = restate.workflow.workflow("acme.myworkflow", {
7373
// typed API similar to how other Restate RPC services work
7474
const workflowApi = myworkflow.api;
7575

76-
restate.createServer().bind(myworkflow).listen(9080);
76+
restate.endpoint().bind(myworkflow).listen(9080);
7777

7878
//
7979
// (2) Code to interact with the workflow using an external client

0 commit comments

Comments
 (0)