diff --git a/client/src/app.service.js b/client/src/app.service.js
new file mode 100644
index 0000000..e8dacb7
--- /dev/null
+++ b/client/src/app.service.js
@@ -0,0 +1,41 @@
+import axios from 'axios'
+
+axios.defaults.baseURL = 'http://localhost:5000'
+
+// To avoid adding the token to every request we make to a service we can
+// instead use an interceptor
+axios.interceptors.request.use(function (config) {
+ // added for when the code is running on a server for serverside rendering
+ if (typeof window === 'undefined') {
+ return config
+ }
+ const token = window.localStorage.getItem('token')
+ if (token) {
+ config.headers.Authorization = `Bearer ${token}`
+ }
+
+ return config
+})
+
+const appService = {
+ getPing() {
+ return new Promise((resolve) => {
+ axios.get('/ping')
+ .then(response => {
+ resolve(response.data)
+ })
+ .catch(error => {alert(error)})
+ })
+ },
+ getAllBooks() {
+ return new Promise((resolve) => {
+ axios.get('/books')
+ .then(response => {
+ resolve(response.data)
+ })
+ .catch(error => {alert(error)})
+ })
+ }
+}
+
+export default appService
\ No newline at end of file
diff --git a/client/src/components/Books.vue b/client/src/components/Books.vue
index 74dae7d..8be8969 100644
--- a/client/src/components/Books.vue
+++ b/client/src/components/Books.vue
@@ -17,18 +17,52 @@
-
-
foo
-
bar
-
foobar
-
-
-
-
-
+
+
{{ book.title }}
+
{{ book.author }}
+
+ Yes
+ No
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/client/src/components/Ping.vue b/client/src/components/Ping.vue
index 66c31c6..86c2b11 100644
--- a/client/src/components/Ping.vue
+++ b/client/src/components/Ping.vue
@@ -5,7 +5,7 @@