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