@@ -56,5 +56,15 @@ module.exports = {
return res.redirect("/");
}
});
+ },
+
+ getData: function(req, res){
+ Currency.find()
+ .then((currencies)=>{
+ return res.json(currencies);
+ })
+ .catch((err)=>{
+ console.error(err);
+ });
@@ -6,8 +6,6 @@
<title>Lee Morgan</title>
</head>
<body>
- <h1>Currencies from around the world</h1>
-
<div id="container">
<template id="currency">
<div class="currency">