diff --git a/packages/dashboard-backend/src/app.ts b/packages/dashboard-backend/src/app.ts index e37bcc621..d99f86fdd 100644 --- a/packages/dashboard-backend/src/app.ts +++ b/packages/dashboard-backend/src/app.ts @@ -112,5 +112,5 @@ export default async function buildApp(server: FastifyInstance): Promise { registerPersonalAccessTokenRoutes(server); - registerGettingStartedSamplesRoutes(server); + registerGettingStartedSamplesRoutes(isLocalRun(), server); } diff --git a/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts b/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts index 55c4f4d9f..f23d39844 100644 --- a/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts +++ b/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts @@ -18,9 +18,15 @@ import { getServiceAccountToken } from './helpers/getServiceAccountToken'; const tags = ['Getting Started Samples']; -export function registerGettingStartedSamplesRoutes(instance: FastifyInstance) { +export function registerGettingStartedSamplesRoutes( + isLocalRun: boolean, + instance: FastifyInstance, +) { instance.register(async server => { server.get(`${baseApiPath}/getting-started-sample`, getSchema({ tags }), async () => { + if (isLocalRun) { + return []; + } const token = getServiceAccountToken(); const { gettingStartedSampleApi } = getDevWorkspaceClient(token); return gettingStartedSampleApi.list();