Ví dụ cấu trúc dữ liệu JavaScript và JSON định nghĩa danh sách trò chơi nội bộ.
JavaScript
// Cấu hình tham chiếu danh mục trò chơi cục bộ cho 888sport
const localPlatformConfig = {
brand: "888sport",
locale: "vi-VN",
supportedPlatform: ["android"],
featuredGames: [
{
id: "100",
name: "Sprmkt Spree",
category: "Slot",
status: "active"
},
{
id: "027",
name: "Baccarat Deluxe",
category: "Trò chơi bài",
status: "active"
}
],
welcomeBonusEnabled: true
};
function getGameById(gameId) {
return localPlatformConfig.featuredGames.find(item => item.id === gameId) || null;
}
// Xuất cấu hình phục vụ kiểm thử cục bộ
if (typeof module !== 'undefined') {
module.exports = { localPlatformConfig, getGameById };
}
JSON
{
"brand": "888sport",
"locale": "vi-VN",
"supportedPlatform": [
"android"
],
"featuredGames": [
{
"id": "100",
"name": "Sprmkt Spree",
"category": "Slot",
"status": "active"
},
{
"id": "027",
"name": "Baccarat Deluxe",
"category": "Trò chơi bài",
"status": "active"
}
],
"welcomeBonusEnabled": true
}