diff --git a/mirage/index.js b/mirage/index.js new file mode 100644 index 0000000..caf6d6e --- /dev/null +++ b/mirage/index.js @@ -0,0 +1,29 @@ +import { Server } from "miragejs" + +new Server({ + routes() { + this.namespace = 'api'; + + this.get('/emails', async () => { + return [{ + id: 1, + subject: 'First Steps', + body: 'Learning Vue with Vue 3, cool!', + read: false, + archived: false, + }, { + id: 2, + subject: 'Vue 3 - pretty cool', + body: 'Lots of really good features happening here', + read: false, + archived: false + }, { + id: 3, + subject: 'Do we have a released date?', + body: "I hear Q2 2020.", + read: true, + archived: false + }] + }, {timing: 2000}) + } +}) diff --git a/src/main.js b/src/main.js index 5820b51..0a8f643 100644 --- a/src/main.js +++ b/src/main.js @@ -1,34 +1,5 @@ import { createApp } from 'vue'; import App from './App.vue'; - -import { Server } from "miragejs" - -new Server({ - routes() { - this.namespace = 'api'; - - this.get('/emails', async () => { - return [{ - id: 1, - subject: 'First Steps', - body: 'Learning Vue with Vue 3, cool!', - read: false, - archived: false, - }, { - id: 2, - subject: 'Vue 3 - pretty cool', - body: 'Lots of really good features happening here', - read: false, - archived: false - }, { - id: 3, - subject: 'Do we have a released date?', - body: "I hear Q2 2020.", - read: true, - archived: false - }] - }, {timing: 2000}) - } -}) +import '../mirage/index'; createApp(App).mount('#app');