Rebase to master when repo went private

This commit is contained in:
Your Name
2020-08-17 13:31:05 +01:00
commit fe20b27432
345 changed files with 28876 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import { AppService } from './app.service';
@Injectable({
providedIn: 'root',
})
export class RepoService {
allApps: any = {};
indexUrl: string = 'https://the-expanse.github.io/SideQuestRepos/';
constructor(private appService: AppService) {
this.getAppIndex();
}
getAppIndex() {
this.appService.request(this.indexUrl);
return new Promise((resolve, reject) => {
this.appService.request(this.indexUrl + 'app-index.json', (error, response, body) => {
if (error) {
return reject(error);
} else {
try {
let body = JSON.parse(response.body);
Object.keys(body).forEach(packageName => {
this.allApps[packageName] = body[packageName];
this.allApps[packageName].icon = this.indexUrl + this.allApps[packageName].icon;
});
resolve();
} catch (e) {
return reject('JSON parse Error');
}
}
});
});
}
}