Skip to content

Commit fd9ffd8

Browse files
committed
Merge branch 'main' into vercel_tc
2 parents fef2c6f + 407dad7 commit fd9ffd8

File tree

60 files changed

+150
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+150
-58
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
.tinyb
44
.tb_error.txt
55
.tmp
6+
.tb_error*
7+
tinybird/fixtures
8+

README.md

Lines changed: 2 additions & 2 deletions

TEMPLATE.md

Lines changed: 1 addition & 1 deletion

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(), {

apps/web/src/lib/constants.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import dynamic from 'next/dynamic';
22

3-
export const baseURL = process.env.NEXT_PUBLIC_VERCEL_URL
4-
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
5-
: 'http://localhost:3000';
3+
export const baseURL = (() => {
4+
// Preview deployments
5+
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
6+
return `https://${process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL}`;
7+
}
8+
9+
// Production URL
10+
if (process.env.NEXT_PUBLIC_VERCEL_URL) {
11+
return `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`;
12+
}
13+
14+
// Local development
15+
return 'http://localhost:3000';
16+
})();
617

718
export type ToolState = 'available' | 'installed' | 'configured';
819

tinybird/pipes/auth0_apis.pipe

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ SQL >
2727
event.data.audience::String
2828
ORDER BY
2929
total_events DESC
30+
31+
TYPE ENDPOINT

tinybird/pipes/auth0_applications.pipe

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ SQL >
2626
event.data.client_name::String
2727
ORDER BY
2828
total_events DESC
29+
30+
TYPE ENDPOINT

tinybird/pipes/auth0_connections.pipe

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ SQL >
3434
failed_attempts > 0
3535
ORDER BY
3636
total_events DESC
37+
38+
TYPE ENDPOINT

0 commit comments

Comments
 (0)