Contoh berkas konfigurasi lokal untuk pengelompokan panduan permainan.
{ } guide-config.js{ } guide-config.json
Salin kode
JavaScript
// Konfigurasi objek lokal untuk navigasi jalur panduan pemula api22
const beginnerGuideConfig = {
platformName: "api22" ,
countryTarget: "id" ,
featuredCategories: [
{
categoryId: "action" ,
title: "Aksi & Bertahan Hidup" ,
recommendedGames: ["156" , "140" ],
guideUrl: "/play-guides/game-156/"
},
{
categoryId: "adventure" ,
title: "Petualangan Mitologi" ,
recommendedGames: ["155" ],
guideUrl: "/play-guides/game-155/"
}
],
defaultOnboardingRoute: "/help/onboarding/"
};
// Fungsi penolong lokal untuk memvalidasi rute internal
function getRouteForCategory(catId) {
const item = beginnerGuideConfig.featuredCategories.find(c => c.categoryId === catId);
return item ? item.guideUrl : beginnerGuideConfig.defaultOnboardingRoute;
} JSON
{
"platformName" : "api22" ,
"countryTarget" : "id" ,
"featuredCategories" : [
{
"categoryId" : "action" ,
"title" : "Aksi & Bertahan Hidup" ,
"recommendedGames" : ["156" , "140" ],
"guideUrl" : "/play-guides/game-156/"
},
{
"categoryId" : "adventure" ,
"title" : "Petualangan Mitologi" ,
"recommendedGames" : ["155" ],
"guideUrl" : "/play-guides/game-155/"
}
],
"defaultOnboardingRoute" : "/help/onboarding/"
}