Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const createMockServer = () => {
const server = new Server(createMockServerOptions());
return server;
};
export function startMirage() {
return new Server({
trackRequests: true,
environment: 'test',
namespace: 'plate_picks',
models: {
plate: Model,
batch: Model,
},
routes() {
this.get('plates/:barcode', (schema, request) => {
return schema.plates.findBy({ barcode: request.params.barcode })
})
this.resource('batches')
},
})
}