Skip to content

Commit

Permalink
use real data and log error
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Jul 27, 2018
1 parent f352876 commit 2c4e50b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
41 changes: 21 additions & 20 deletions server/artifactory-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ const repoKey = config.artifactory.repoKey;

module.exports = {
fetchPackages: async () => {
// return await axios.get(`${repoKey}/-/all`);
return new Promise((resolve, reject) => {
resolve({data: {
module1: {
name: "hello",
description: "Beschreibung",
author: "icke eben"
},
module2: {
name: "hello",
description: "Beschreibung",
author: "icke eben"
},
module3: {
name: "hello",
description: "Beschreibung",
author: "icke eben"
}
}});
});
const request = axios.get(`${repoKey}/-/all`);
return request;
// return new Promise((resolve, reject) => {
// resolve({data: {
// module1: {
// name: "hello",
// description: "Beschreibung",
// author: "icke eben"
// },
// module2: {
// name: "hello",
// description: "Beschreibung",
// author: "icke eben"
// },
// module3: {
// name: "hello",
// description: "Beschreibung",
// author: "icke eben"
// }
// }});
// });
}
};
2 changes: 2 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ app.use(cors())
app.get('/packages', function(req, res) {
artifactoryService.fetchPackages().then(response => {
res.send(response.data);
}).catch(error => {
console.log(error);
});
});

Expand Down

0 comments on commit 2c4e50b

Please sign in to comment.