You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a multi-page aurelia app using a shared main.ts. So, depending on the location of the current index.html, the path to the config file changes.
The config file and folder are defaults. So, a "config" folder in the root of the website with a config.json.
I have some logic to determine the path back to this location, but using setDirectory never changes this.
For example: config.setDirectory('../../config') does nothing. It tries to find the config location in the current folder. Interestingly, if i use ../../testconfig, it does look for the correct name (testconfig), but still at the current folder path rather than backing up two folders.
Here's a code snippet:
.plugin('aurelia-configuration', config => {
let configFolderParts = window.location.pathname.split('/');
if (configFolderParts.length > 1) {
let levels = configFolderParts.filter(i => i !== "").map(i => "../");
let configFolder = levels.reduce((path, i) => path = path + '../');
let newDirectory = ${configFolder}config;
config.setDirectory(newDirectory);
}
config.setEnvironments({
development: ['localhost','localhost:.'],
test: ['appdev.essette.com'],
prod: ['prod.essette.com']
});
})
The text was updated successfully, but these errors were encountered:
@nickj41 sorry for the delay, I am looking at this issue as part of a next update which will hopefully streamline and simplify the loading of configuration files and path configuration.
I have a multi-page aurelia app using a shared main.ts. So, depending on the location of the current index.html, the path to the config file changes.
The config file and folder are defaults. So, a "config" folder in the root of the website with a config.json.
I have some logic to determine the path back to this location, but using setDirectory never changes this.
For example: config.setDirectory('../../config') does nothing. It tries to find the config location in the current folder. Interestingly, if i use ../../testconfig, it does look for the correct name (testconfig), but still at the current folder path rather than backing up two folders.
Here's a code snippet:
.plugin('aurelia-configuration', config => {
let configFolderParts = window.location.pathname.split('/');
if (configFolderParts.length > 1) {
let levels = configFolderParts.filter(i => i !== "").map(i => "../");
let configFolder = levels.reduce((path, i) => path = path + '../');
let newDirectory =
${configFolder}config
;config.setDirectory(newDirectory);
}
config.setEnvironments({
development: ['localhost','localhost:.'],
test: ['appdev.essette.com'],
prod: ['prod.essette.com']
});
})
The text was updated successfully, but these errors were encountered: