decide.nolog.cz/mirage/config.js
Jeldrik Hanschke 748b17e0ea
answers could be derived from answerType (#704)
* answers could be derived from answerType

* improve readability of API test data

* update API tests for removed answers property
2023-10-23 17:33:25 +02:00

20 lines
473 B
JavaScript

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
this.get('/polls/:id');
this.post('/polls');
this.post('/users');
}