diff --git a/routes/project.ts b/routes/project.ts index 802062b929f88d08c260744c950130995cb66294..86bce9b32e7d1a88aaee540d622088fff48a4b2f 100644 --- a/routes/project.ts +++ b/routes/project.ts @@ -2,6 +2,7 @@ import methods from '../functions/methods' import gitlab from '../functions/gitlab' import helpers from '../functions/helpers' +import https from 'https' module.exports = function (app:any, lang:string) { @@ -142,7 +143,7 @@ module.exports = function (app:any, lang:string) { // Projektinformationen app.get('/projektinformationen', async function(req:any, res:any){ - let pagesArr = [] + let pagesArr: { logo: any; name: any; weburl: any; desc: any; keywords: any; createdAt: any; lastUpdatedAt: any; }[] = [] let isProject = true let firstId = 0 let orderKeyword = req.query.sort @@ -183,7 +184,12 @@ module.exports = function (app:any, lang:string) { createdAt: pagesData[i].created_at, lastUpdatedAt: pagesData[i].last_activity_at } - pagesArr.push(pages) + + https.get(pagesData[i].web_url, function (response:any) { + if (response.statusCode >= 200 && response.statusCode <= 299) { + pagesArr.push(pages) + } + }) } } firstId = pagesData[pagesData.length-1].id