Fixed catch statements not having arguments on backend

Fixed backend location url not working when not in root dir on web server
This commit is contained in:
Isaac Grynsztein
2020-02-17 17:42:21 -05:00
parent 710e3613a8
commit 1e4995c5ce
2 changed files with 17 additions and 19 deletions

View File

@@ -60,8 +60,10 @@ export class PostsService {
if (isDevMode()) {
return this.http.get('./assets/default.json');
}
console.log('Config location: ' + window.location.href + 'backend/config/default.json');
return this.http.get(window.location.href + 'backend/config/default.json');
const locations = window.location.href.split('#');
const current_location = locations[0];
console.log('Config location: ' + current_location + 'backend/config/default.json');
return this.http.get(current_location + 'backend/config/default.json');
}
deleteFile(name: string, isAudio: boolean) {