]>
git.immae.eu Git - github/bastienwirtz/homer.git/blob - app.js
10 return getConfig().then(function (config
) {
13 config
.services
.forEach(function(service
) {
15 items
= service
.items
;
16 while (items
.length
) {
17 service
.rows
.push(items
.splice(0, size
));
20 if (service
.rows
.length
) {
21 let last
= service
.rows
.length
-1;
22 service
.rows
[last
] = service
.rows
[last
].concat(Array(size
- service
.rows
[last
].length
));
26 }).catch(function () {
27 console
.error('Fail to get config');
33 function getConfig() {
34 return fetch('config.yml').then(function(response
) {
35 if (response
.status
!== 200) {
39 return response
.text().then(function(body
){
40 return jsyaml
.load(body
);