Files
comedy-video-lib/plugins/mirage.js
Kevin ANATOLE fe1a5d77c3 Installing MirageJS
- Added axios configuration
- Added miragejs to mock api calls
2020-11-09 20:55:10 +00:00

24 lines
474 B
JavaScript

import { createServer } from 'miragejs'
if (process.env.NODE_ENV === 'development') {
startServer(0)
}
function startServer() {
createServer({
routes() {
this.namespace = 'api'
this.get('/movies', () => {
return {
movies: [
{ id: 1, name: 'Inception', year: 2010 },
{ id: 2, name: 'Interstellar', year: 2014 },
{ id: 3, name: 'Dunkirk', year: 2017 },
],
}
})
},
})
}