Mô hình tệp cấu hình tham khảo để thiết lập và hiển thị danh sách trò chơi cục bộ.
{ } example.js{ } example.json
Sao chép mã
JavaScript
// Cau hinh danh muc tro choi cuc bo cho tn88
const localGameCatalog = {
brand: "tn88" ,
domain: "tn88games.com" ,
supportedPlatform: "android" ,
defaultCategory: "Slot" ,
featuredGames: [
{ id: "088" , name: "Bali Vacation" , category: "Slot" },
{ id: "022" , name: "Legend Of Hou Yi" , category: "Slot" },
{ id: "126" , name: "Diner Delights" , category: "Slot" },
{ id: "178" , name: "Galaxy Miner" , category: "Slot" },
{ id: "179" , name: "Grimm Bounty" , category: "Slot" }
]
};
function getGameById(id) {
return localGameCatalog.featuredGames.find(g => g.id === id) || null ;
}
// Kiem tra du lieu mau
console.log("Trang thai khoi tao:" , localGameCatalog.brand); JSON
{
"brand" : "tn88" ,
"domain" : "tn88games.com" ,
"supportedPlatform" : "android" ,
"defaultCategory" : "Slot" ,
"featuredGames" : [
{
"id" : "088" ,
"name" : "Bali Vacation" ,
"category" : "Slot"
},
{
"id" : "022" ,
"name" : "Legend Of Hou Yi" ,
"category" : "Slot"
},
{
"id" : "126" ,
"name" : "Diner Delights" ,
"category" : "Slot"
},
{
"id" : "178" ,
"name" : "Galaxy Miner" ,
"category" : "Slot"
},
{
"id" : "179" ,
"name" : "Grimm Bounty" ,
"category" : "Slot"
}
]
}