Skip to content

Commit f15aa39

Browse files
committed
use env variable for tb domain
1 parent 332c4e6 commit f15aa39

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.venv
33
.tinyb
44
.tmp
5+
.tb_error*
6+
tinybird/fixtures

apps/web/src/app/api/datasources/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function GET(request: Request) {
88
return NextResponse.json({ error: 'Token is required' }, { status: 400 });
99
}
1010

11-
const response = await fetch('https://api.tinybird.co/v0/datasources', {
11+
const response = await fetch(`${process.env.NEXT_PUBLIC_TINYBIRD_API_HOST}/v0/datasources`, {
1212
headers: {
1313
'Authorization': `Bearer ${token}`,
1414
},

apps/web/src/app/api/pipes/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextRequest, NextResponse } from "next/server";
22

3-
const TINYBIRD_API_URL = "https://api.tinybird.co/v0/pipes";
3+
const TINYBIRD_API_URL = `${process.env.NEXT_PUBLIC_TINYBIRD_API_HOST}/v0/pipes`;
44

55
export async function GET(request: NextRequest) {
66
const searchParams = request.nextUrl.searchParams;

apps/web/src/app/api/query/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function GET(request: Request) {
99
return NextResponse.json({ error: 'Token and query are required' }, { status: 400 });
1010
}
1111

12-
const url = new URL('https://api.tinybird.co/v0/sql');
12+
const url = new URL(`${process.env.NEXT_PUBLIC_TINYBIRD_API_HOST}/v0/sql`);
1313
url.searchParams.set('q', query);
1414

1515
const response = await fetch(url.toString(), {

0 commit comments

Comments
 (0)