The CI server runs a plain `next build` in apps/demo; it never reads vercel.json, so `app:build` and its API URL were skipped. With no URL the app fell back to the demo data source, which only works inside the hosted artifact sandbox, and rezina.yaltopia.com showed "0 courses". - the API URL is now the default in apps/demo/app/page.tsx; any plain build uses it - NEXT_PUBLIC_LMS_API still overrides it (e.g. staging); set empty, it keeps demo data - `demo:build` sets it empty: the artifact sandbox can't reach outside servers (artifact check: no network attempts) - `app:build` is now just the plain build; README updated
15 lines
708 B
TypeScript
15 lines
708 B
TypeScript
'use client';
|
|
import { ApiDataSource, ClaudeDbDataSource } from '@lms/data';
|
|
import { Platform } from '@lms/features';
|
|
|
|
// Any plain build (`next build`, as the CI server runs it) talks to the real API.
|
|
// The hosted artifact demo opts out by building with NEXT_PUBLIC_LMS_API set to an empty value (`demo:build`):
|
|
// its sandbox can't reach outside servers, so it keeps its own data. Another API (e.g. staging) is a different value.
|
|
const DEFAULT_API = 'https://api.rezina.yaltopia.com';
|
|
const API = process.env.NEXT_PUBLIC_LMS_API ?? DEFAULT_API;
|
|
const makeDs = () => (API ? new ApiDataSource(API) : new ClaudeDbDataSource());
|
|
|
|
export default function Page() {
|
|
return <Platform dataSource={makeDs} />;
|
|
}
|