Contoh implementasi rute bantuan lokal berbasis JavaScript dan JSON.
{ } example.js{ } example.json
Salin kode
JavaScript
// Konfigurasi pemetaan rute lokal bantuan rt88
const helpdeskConfig = {
brand: "rt88" ,
country: "id" ,
endpoints: {
download: "/download/" ,
registration: "/register/" ,
troubleshooting: "/help/troubleshooting/"
},
featuredGames: [
{ id: "197" , name: "Monkey Wild Pty" },
{ id: "133" , name: "Songkran Spl" }
]
};
function getRedirectUrl(section) {
return helpdeskConfig.endpoints[section] || "/" ;
}
module.exports = { helpdeskConfig, getRedirectUrl }; JSON
{
"brand" : "rt88" ,
"country" : "id" ,
"endpoints" : {
"download" : "/download/" ,
"registration" : "/register/" ,
"troubleshooting" : "/help/troubleshooting/"
},
"featuredGames" : [
{
"id" : "197" ,
"name" : "Monkey Wild Pty"
},
{
"id" : "133" ,
"name" : "Songkran Spl"
}
]
}