Struktur kode JavaScript dan JSON untuk pengelolaan data katalog lokal n9n9.
{ } catalogConfig.js{ } catalogConfig.json
Salin kode
JavaScript
// Konfigurasi objek lokal katalog game n9n9
const localCatalogConfig = {
brand: "n9n9" ,
environment: "production" ,
defaultLanguage: "id" ,
catalog: [
{ id: "071" , name: "Circus Delight" , category: "Slot" },
{ id: "058" , name: "Candy Burst" , category: "Slot" },
{ id: "195" , name: "Super Wildrix" , category: "Slot" },
{ id: "022" , name: "Legend Of Hou Yi" , category: "Slot" },
{ id: "047" , name: "Ninja Vs Samurai" , category: "Slot" }
]
};
function getGameMetadata(gameId) {
return localCatalogConfig.catalog.find(item => item.id === gameId) || null ;
}
module.exports = { localCatalogConfig, getGameMetadata }; JSON
{
"brand" : "n9n9" ,
"environment" : "production" ,
"defaultLanguage" : "id" ,
"catalog" : [
{
"id" : "071" ,
"name" : "Circus Delight" ,
"category" : "Slot"
},
{
"id" : "058" ,
"name" : "Candy Burst" ,
"category" : "Slot"
},
{
"id" : "195" ,
"name" : "Super Wildrix" ,
"category" : "Slot"
},
{
"id" : "022" ,
"name" : "Legend Of Hou Yi" ,
"category" : "Slot"
},
{
"id" : "047" ,
"name" : "Ninja Vs Samurai" ,
"category" : "Slot"
}
]
}