Contoh konfigurasi skema data lokal katalog permainan api22.
{ } example.js{ } example.json
Salin kode
JavaScript
// Konfigurasi objek lingkungan pengujian lokal api22
const platformConfig = {
brand: "api22" ,
environment: "local-sandbox" ,
supportedPlatform: "android" ,
catalog: [
{ id: "054" , title: "Reel Love" , type: "Slot" },
{ id: "088" , title: "Bali Vacation" , type: "Slot" },
{ id: "188" , title: "Fortune Horse" , type: "Slot" },
{ id: "059" , title: "Bikini Paradise" , type: "Slot" },
{ id: "094" , title: "Heist Stakes" , type: "Slot" }
]
};
function getFeaturedGame(id) {
return platformConfig.catalog.find(game => game.id === id) || null ;
}
// Cetak hasil simulasi pemetaan data
console.log("Featured game:" , getFeaturedGame("088" )); JSON
{
"brand" : "api22" ,
"environment" : "local-sandbox" ,
"supportedPlatform" : "android" ,
"catalog" : [
{
"id" : "054" ,
"title" : "Reel Love" ,
"type" : "Slot"
},
{
"id" : "088" ,
"title" : "Bali Vacation" ,
"type" : "Slot"
},
{
"id" : "188" ,
"title" : "Fortune Horse" ,
"type" : "Slot"
},
{
"id" : "059" ,
"title" : "Bikini Paradise" ,
"type" : "Slot"
},
{
"id" : "094" ,
"title" : "Heist Stakes" ,
"type" : "Slot"
}
]
}