@@ -346,7 +346,7 @@ if (CURRICULUM_ROOT) {
346
346
data = await findCurriculumPageBySlug ( slug ) ;
347
347
} else {
348
348
try {
349
- data = await fetch_from_rari ( req . path ) ;
349
+ data = await fetch_from_rari ( req . path . replace ( / i n d e x \. j s o n $ / , "" ) ) ;
350
350
} catch ( error ) {
351
351
return res . status ( 500 ) . json ( JSON . stringify ( error . toString ( ) ) ) ;
352
352
}
@@ -374,7 +374,9 @@ if (BLOG_ROOT) {
374
374
return res . json ( { hyData : { posts } } ) ;
375
375
} else {
376
376
try {
377
- const index = await fetch_from_rari ( req . path ) ;
377
+ const index = await fetch_from_rari (
378
+ req . path . replace ( / i n d e x \. j s o n $ / , "" )
379
+ ) ;
378
380
return res . json ( index ) ;
379
381
} catch ( error ) {
380
382
return res . status ( 500 ) . json ( JSON . stringify ( error . toString ( ) ) ) ;
@@ -404,7 +406,9 @@ if (BLOG_ROOT) {
404
406
return res . json ( data ) ;
405
407
} else {
406
408
try {
407
- const index = await fetch_from_rari ( req . path ) ;
409
+ const index = await fetch_from_rari (
410
+ req . path . replace ( / i n d e x \. j s o n $ / , "" )
411
+ ) ;
408
412
return res . json ( index ) ;
409
413
} catch ( error ) {
410
414
return res . status ( 500 ) . json ( JSON . stringify ( error . toString ( ) ) ) ;
@@ -446,7 +450,7 @@ if (contentProxy) {
446
450
}
447
451
} ) ;
448
452
app . get ( "/[^/]+/docs/*/index.json" , async ( req , res ) => {
449
- const url = decodeURI ( req . path . replace ( / \/ i n d e x .j s o n $ / , "" ) ) ;
453
+ const url = decodeURI ( req . path . replace ( / \/ i n d e x \ .j s o n $ / , "" ) ) ;
450
454
try {
451
455
const doc = await buildDocumentFromURL ( url ) ;
452
456
if ( ! doc ) {
@@ -513,7 +517,9 @@ if (RARI) {
513
517
] ,
514
518
async ( req , res ) => {
515
519
try {
516
- const index = await fetch_from_rari ( req . path ) ;
520
+ const index = await fetch_from_rari (
521
+ req . path . replace ( / i n d e x \. j s o n $ / , "" )
522
+ ) ;
517
523
if ( req . path . endsWith ( ".json" ) ) {
518
524
return res . json ( index ) ;
519
525
}
0 commit comments