decide.nolog.cz/mirage/config.js

21 lines
473 B
JavaScript
Raw Permalink Normal View History

import { createServer } from 'miragejs';
export default function (config) {
const finalConfig = {
...config,
routes,
};
return createServer(finalConfig);
}
function routes() {
this.logging = true;
this.namespace = '/api/index.php'; // make this `api`, for example, if your API is namespaced
this.timing = 400; // delay for each request, automatically set to 0 during testing
2016-12-19 17:04:09 +01:00
this.get('/polls/:id');
this.post('/polls');
this.post('/users');
}