Struktur konfigurasi objek statis JavaScript dan JSON untuk pengujian tata letak lokal.
{ } client-config.js{ } client-config.json
Salin kode
JavaScript
/**
* Contoh konfigurasi lokal klien byd108game
* Digunakan untuk manajemen state tata letak dan katalog offline
*/
const bydConfig = {
platform: 'byd108game' ,
targetEnv: 'production' ,
locale: 'id-ID' ,
supportedPlatforms: ['android' , 'web' ],
initialGames: [
{ id: '149' , name: 'Fortune Dragon' , category: 'Slot' },
{ id: '197' , name: 'Monkey Wild Pty' , category: 'Slot' },
{ id: '001' , name: 'Diaochan' , category: 'Slot' },
{ id: '187' , name: 'Forbid Alchemy' , category: 'Slot' },
{ id: '042' , name: 'Journey To The Wealth' , category: 'Slot' }
],
features: {
enableGuestPreview: true ,
autoSaveSession: true
}
};
function getGameInfo(gameId) {
return bydConfig.initialGames.find(g => g.id === gameId) || null ;
}
// Ekspor objek lokal untuk pengujian komponen UI
module.exports = { bydConfig, getGameInfo }; JSON
{
"platform" : "byd108game" ,
"targetEnv" : "production" ,
"locale" : "id-ID" ,
"supportedPlatforms" : [
"android" ,
"web"
],
"initialGames" : [
{
"id" : "149" ,
"name" : "Fortune Dragon" ,
"category" : "Slot"
},
{
"id" : "197" ,
"name" : "Monkey Wild Pty" ,
"category" : "Slot"
},
{
"id" : "001" ,
"name" : "Diaochan" ,
"category" : "Slot"
},
{
"id" : "187" ,
"name" : "Forbid Alchemy" ,
"category" : "Slot"
},
{
"id" : "042" ,
"name" : "Journey To The Wealth" ,
"category" : "Slot"
}
],
"features" : {
"enableGuestPreview" : true ,
"autoSaveSession" : true
}
}