Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit d1391f6

Browse files
committed
fix(examples-*): fix cors configs (#1393)
1 parent e12f879 commit d1391f6

File tree

14 files changed

+38
-11
lines changed

14 files changed

+38
-11
lines changed

examples/ai-agent/src/backend/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registry } from "./registry";
22

33
registry.start({
44
cors: {
5-
origin: "http://localhost:5173",
5+
origin: "http://localhost:3000",
6+
credentials: true,
67
},
78
});

examples/better-auth-external-db/src/backend/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import { auth } from "./auth";
66
import { registry } from "./registry";
77

88
// Start RivetKit
9-
registry.start();
9+
registry.start({
10+
cors: {
11+
origin: "http://localhost:5173",
12+
credentials: true,
13+
},
14+
});
1015

1116
// Setup router
1217
const app = new Hono();

examples/crdt/src/backend/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registry } from "./registry";
22

33
registry.start({
44
cors: {
5-
origin: "http://localhost:5173",
5+
origin: "http://localhost:3000",
6+
credentials: true,
67
},
78
});

examples/database/src/backend/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registry } from "./registry";
22

33
registry.start({
44
cors: {
5-
origin: "http://localhost:5173",
5+
origin: "http://localhost:3000",
6+
credentials: true,
67
},
78
});

examples/game/src/backend/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registry } from "./registry";
22

33
registry.start({
44
cors: {
5-
origin: "http://localhost:5173",
5+
origin: "http://localhost:3000",
6+
credentials: true,
67
},
78
});

examples/hono-bun/src/backend/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const { client, fetch } = registry.start({
1313
getUpgradeWebSocket: () => upgradeWebSocket,
1414
cors: {
1515
origin: "http://localhost:5173",
16+
credentials: true,
1617
},
1718
});
1819

examples/hono-react/src/backend/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { registry } from "./registry";
55
const { client } = registry.start({
66
cors: {
77
origin: "http://localhost:5173",
8+
credentials: true,
89
},
910
});
1011

examples/rate/src/backend/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registry } from "./registry";
22

33
registry.start({
44
cors: {
5-
origin: "http://localhost:5173",
5+
origin: "http://localhost:3000",
6+
credentials: true,
67
},
78
});

examples/raw-fetch-handler/src/backend/server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ import { cors } from "hono/cors";
44
import { registry } from "./registry";
55

66
// Start RivetKit
7-
const { client } = registry.start();
7+
const { client } = registry.start({
8+
cors: {
9+
origin: "http://localhost:5173",
10+
credentials: true,
11+
},
12+
});
813

914
// Setup router
1015
const app = new Hono();
1116

1217
app.use(
1318
cors({
1419
origin: "http://localhost:5173",
20+
credentials: true,
1521
}),
1622
);
1723

examples/raw-websocket-handler-proxy/src/backend/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { createNodeWebSocket } from "@hono/node-ws";
33
import { Hono } from "hono";
44
import { registry } from "./registry.js";
55

6-
const { client } = registry.start();
6+
const { client } = registry.start({
7+
cors: {
8+
origin: "http://localhost:5173",
9+
credentials: true,
10+
},
11+
});
712

813
const app = new Hono();
914
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app });

0 commit comments

Comments
 (0)