Skip to content

Commit

Permalink
[UPD] config
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed May 3, 2024
1 parent feea234 commit a816e25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import importConfig from '../config/import'
// Default options
let options = {
server: 'https://server.ign.fr/',
viewer: 'SERVER/$TYPE/$ID/$TITLE',
viewer: 'SERVER/carte/$ID/$TITLE?$NOTITLE',
userProfile: 'SERVER/utilisateur/$NAME',
teamProfile: 'SERVER/equipe/$NAME',
editor: 'SERVER/edition/$TYPE/$ID',
Expand All @@ -15,6 +15,7 @@ let options = {
gppKey: 'k1RSRVIYRxteMEcPK9A5c7g0C6KRw4KX',
};

console.log('options', options)
// Get server options using global options
if (!window.maCarteOptions) {
importConfig('./config.json')
Expand All @@ -25,8 +26,9 @@ if (window.maCarteOptions) {
}
delete window.maCarteOptions;
// Update server url
const server = options.server.replace(/\/$/,'');
for (let i in options) {
if (options[i].replace) options[i] = options[i].replace(/^SERVER/, options.server)
if (options[i].replace) options[i] = options[i].replace(/^SERVER/, server)
};
} else {
console.error('NO CONFIG FILE!\n Ajouter un fichier confg.json dans le répertoire des assets...');
Expand Down

0 comments on commit a816e25

Please sign in to comment.