diff --git a/app/adapters/application.js b/app/adapters/application.js
new file mode 100644
index 0000000..2744f76
--- /dev/null
+++ b/app/adapters/application.js
@@ -0,0 +1,5 @@
+import JSONAPIAdapter from '@ember-data/adapter/json-api';
+
+export default class ApplicationAdapter extends JSONAPIAdapter {
+ host = 'https://www.themealdb.com/api/json/v1/1';
+}
diff --git a/app/adapters/meal.js b/app/adapters/meal.js
new file mode 100644
index 0000000..3183cb1
--- /dev/null
+++ b/app/adapters/meal.js
@@ -0,0 +1,40 @@
+import ApplicationAdapter from './application';
+import { dasherize } from '@ember/string';
+
+export default class MealAdapter extends ApplicationAdapter {
+ async findRecord(store, model, id) {
+ let result = await fetch(`${this.host}/lookup.php?i=${id}`);
+ let json = await result.json();
+ return normalize(json.meals[0]);
+ }
+
+ async queryRecord(store, model, query) {
+ if (query === 'random') {
+ let result = await fetch(`${this.host}/random.php`);
+ let json = await result.json();
+ return normalize(json.meals[0]);
+ }
+ }
+}
+
+function normalize(obj) {
+ let attributes = {};
+
+ Object.keys(obj).forEach(key => attributes[cleanKey(key)] = obj[key]);
+
+ return {
+ data: {
+ type: 'meal',
+ id: attributes.id,
+ attributes,
+ },
+ };
+}
+
+function cleanKey(key) {
+ key = dasherize(key);
+ key = key.replace('str-', '');
+ if (key === 'id-meal') key = 'id';
+ if (key === 'meal') key = 'name';
+ return key;
+}
diff --git a/app/components/meal-tag.hbs b/app/components/meal-tag.hbs
new file mode 100644
index 0000000..50c1b23
--- /dev/null
+++ b/app/components/meal-tag.hbs
@@ -0,0 +1,3 @@
+
+ #{{yield}}
+
diff --git a/app/components/recipe-list.hbs b/app/components/recipe-list.hbs
index f875b7f..12a6053 100644
--- a/app/components/recipe-list.hbs
+++ b/app/components/recipe-list.hbs
@@ -7,7 +7,7 @@
@model={{meal}}
as |item|>
- Lorem... + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.
+ {{@model.instructions}} +
+ + +