Skip to content

Commit c54bfbd

Browse files
authored
Convex (#41)
1 parent d564d96 commit c54bfbd

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NEXT_PUBLIC_CONVEX_URL="https://warmhearted-scorpion-889.convex.cloud"
2-
TIGRIS_API_URL="https://api.cell1.us-east-1.aws.tigrisdata.cloud/v1"
1+
NEXT_PUBLIC_CONVEX_URL="https://warmhearted-scorpion-889.edge.convex.cloud"
2+
TIGRIS_API_URL="https://api.cell1.us-east-1.aws.tigrisdata.cloud/v1"

pages/api/convex-global.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ export const config = {
66
runtime: "edge",
77
};
88

9-
// Make sure we use the Edge endpoints.
10-
let url = process.env.NEXT_PUBLIC_CONVEX_URL;
11-
if (!url.endsWith("edge.convex.cloud")) {
12-
url = url.replace(/convex.cloud$/g, "edge.convex.cloud");
13-
}
14-
9+
const url = process.env.NEXT_PUBLIC_CONVEX_URL;
1510
const convex = new ConvexHttpClient(url);
1611

1712
const start = Date.now();

pages/api/convex-node.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import { ConvexHttpClient } from "convex/browser";
22
import type { NextApiRequest, NextApiResponse } from "next";
33
import { api as convexApi } from "../../convex/_generated/api";
44

5-
// Make sure we use the Edge endpoints.
6-
let url = process.env.NEXT_PUBLIC_CONVEX_URL;
7-
if (!url.endsWith("edge.convex.cloud")) {
8-
url = url.replace(/convex.cloud$/g, "edge.convex.cloud");
9-
}
10-
5+
const url = process.env.NEXT_PUBLIC_CONVEX_URL;
116
const convex = new ConvexHttpClient(url);
127

138
const start = Date.now();

0 commit comments

Comments
 (0)