Contoh berkas konfigurasi JavaScript dan JSON untuk struktur data katalog game.
{ } example.js{ } example.json
Salin kode
JavaScript
// Konfigurasi objek permainan lokal rt66
const localGameConfig = {
brand: 'rt66' ,
country: 'id' ,
locale: 'id-ID' ,
defaultGame: '050' ,
featuredGames: [
{ id: '050' , name: 'Mahjong Ways' , category: 'Slot' },
{ id: '152' , name: 'Wild Ape 3258' , category: 'Slot' },
{ id: '103' , name: 'Spirit Wonder' , category: 'Slot' }
]
};
function getGameMetadata(gameId) {
return localGameConfig.featuredGames.find(item => item.id === gameId) || null ;
}
// Ekspor objek konfigurasi lokal
module.exports = { localGameConfig, getGameMetadata }; JSON
{
"brand" : "rt66" ,
"country" : "id" ,
"locale" : "id-ID" ,
"defaultGame" : "050" ,
"featuredGames" : [
{
"id" : "050" ,
"name" : "Mahjong Ways" ,
"category" : "Slot"
},
{
"id" : "152" ,
"name" : "Wild Ape 3258" ,
"category" : "Slot"
},
{
"id" : "103" ,
"name" : "Spirit Wonder" ,
"category" : "Slot"
}
]
}