Skip to content

Commit 2a2e0d1

Browse files
committed
Small api deployment fixes
1 parent ef04771 commit 2a2e0d1

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

apps/api/src/routes/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const dataRoutes: FastifyPluginAsync = async (app) => {
6767
schema: {
6868
params: {
6969
type: "object",
70-
properties: { id: { type: "string", minLength: 10, maxLength: 10 } },
70+
properties: { id: { type: "string", minLength: 16, maxLength: 16 } },
7171
required: ["id"],
7272
},
7373
},

apps/api/src/routes/map.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const mapRoutes: FastifyPluginAsync = async (app) => {
2727
schema: {
2828
params: {
2929
type: "object",
30-
properties: { id: { type: "string", minLength: 10, maxLength: 10 } },
30+
properties: { id: { type: "string", minLength: 16, maxLength: 16 } },
3131
required: ["id"],
3232
},
3333
},
@@ -48,7 +48,7 @@ const mapRoutes: FastifyPluginAsync = async (app) => {
4848
schema: {
4949
params: {
5050
type: "object",
51-
properties: { id: { type: "string", minLength: 10, maxLength: 10 } },
51+
properties: { id: { type: "string", minLength: 16, maxLength: 16 } },
5252
required: ["id"],
5353
},
5454
},

apps/web/utils/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ interface ApiError {
88
error?: any;
99
}
1010

11-
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3001";
11+
const NEXT_PUBLIC_API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3001";
12+
const API_URL = process.env.API_URL || "http://localhost:3001";
1213
const JWT_SECRET = process.env.NEXTAUTH_SECRET || "";
1314

1415
export async function fetchApi<T>(endpoint: string, options?: RequestInit): Promise<T> {
1516
const isAbsolute = /^https?:\/\//i.test(endpoint);
16-
const url = isAbsolute ? endpoint : `${API_URL}${endpoint}`;
17+
const url = isAbsolute ? endpoint : `${NEXT_PUBLIC_API_URL}${endpoint}`;
1718

1819
const response = await fetch(url, {
1920
...options,

0 commit comments

Comments
 (0)