fix: youtubeChannel wrong mount path /youtubeapi → /youtube
Build & Deploy / build-and-deploy (push) Successful in 2m10s
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:
@@ -7,13 +7,14 @@
|
|||||||
import { cachedFetch } from "../lib/data-fetch.js";
|
import { cachedFetch } from "../lib/data-fetch.js";
|
||||||
|
|
||||||
const INDIEKIT_URL = process.env.INDIEKIT_URL || process.env.SITE_URL || "https://example.com";
|
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
|
* Fetch from Indiekit's public YouTube API endpoint
|
||||||
*/
|
*/
|
||||||
async function fetchFromIndiekit(endpoint) {
|
async function fetchFromIndiekit(endpoint) {
|
||||||
try {
|
try {
|
||||||
const url = `${INDIEKIT_URL}/youtubeapi/api/${endpoint}`;
|
const url = `${INDIEKIT_URL}${YOUTUBE_MOUNT}/api/${endpoint}`;
|
||||||
console.log(`[youtubeChannel] Fetching from Indiekit: ${url}`);
|
console.log(`[youtubeChannel] Fetching from Indiekit: ${url}`);
|
||||||
const data = await cachedFetch(url, {
|
const data = await cachedFetch(url, {
|
||||||
duration: "5m",
|
duration: "5m",
|
||||||
|
|||||||
Reference in New Issue
Block a user