mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-28 11:39:52 +02:00
fix: replace the api endpoint
This commit is contained in:
committed by
Kamran Ahmed
parent
87280b4c9e
commit
07277708eb
@@ -11,12 +11,10 @@ const roadmapSlug = args?.[0]?.replace('--roadmap-slug=', '');
|
|||||||
const secret = args?.[1]?.replace('--secret=', '');
|
const secret = args?.[1]?.replace('--secret=', '');
|
||||||
if (!secret) {
|
if (!secret) {
|
||||||
throw new Error('Secret is required');
|
throw new Error('Secret is required');
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!roadmapSlug || roadmapSlug === '__default__') {
|
if (!roadmapSlug || roadmapSlug === '__default__') {
|
||||||
throw new Error('Roadmap slug is required');
|
throw new Error('Roadmap slug is required');
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`🚀 Starting ${roadmapSlug}`);
|
console.log(`🚀 Starting ${roadmapSlug}`);
|
||||||
@@ -54,7 +52,7 @@ export async function roadmapTopics(
|
|||||||
roadmapId: string,
|
roadmapId: string,
|
||||||
secret: string,
|
secret: string,
|
||||||
): Promise<OfficialRoadmapTopicContentDocument[]> {
|
): Promise<OfficialRoadmapTopicContentDocument[]> {
|
||||||
const path = `https://api.chit.fun/v1-official-roadmap-topics/${roadmapId}?secret=${secret}`;
|
const path = `https://roadmap.sh/api/v1-list-official-roadmap-topics/${roadmapId}?secret=${secret}`;
|
||||||
const response = await fetch(path);
|
const response = await fetch(path);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`Failed to fetch roadmap topics: ${response.statusText}`);
|
throw new Error(`Failed to fetch roadmap topics: ${response.statusText}`);
|
||||||
|
Reference in New Issue
Block a user