fix: youtubeChannel wrong mount path /youtubeapi → /youtube
Build & Deploy / build-and-deploy (push) Successful in 2m10s

Endpoint is configured with mountPath: '/youtube' in indiekit.config.mjs.
Data file hardcoded /youtubeapi which was never matched → fell through to
auth middleware → 302 redirect.

Uses YOUTUBE_MOUNT_PATH env var (default /youtube) for future flexibility.
This commit is contained in:
svemagie
2026-05-03 13:25:17 +02:00
parent 76f181d517
commit a4d65a6687
+2 -1
View File
@@ -7,13 +7,14 @@
import { cachedFetch } from "../lib/data-fetch.js";
const INDIEKIT_URL = process.env.INDIEKIT_URL || process.env.SITE_URL || "https://example.com";
const YOUTUBE_MOUNT = process.env.YOUTUBE_MOUNT_PATH || "/youtube";
/**
* Fetch from Indiekit's public YouTube API endpoint
*/
async function fetchFromIndiekit(endpoint) {
try {
const url = `${INDIEKIT_URL}/youtubeapi/api/${endpoint}`;
const url = `${INDIEKIT_URL}${YOUTUBE_MOUNT}/api/${endpoint}`;
console.log(`[youtubeChannel] Fetching from Indiekit: ${url}`);
const data = await cachedFetch(url, {
duration: "5m",