Skip to content

Instantly share code, notes, and snippets.

@carrfane
Created November 20, 2019 14:59
Show Gist options
  • Save carrfane/b209263df2bd09031ebf3bc4ded4ed2c to your computer and use it in GitHub Desktop.
Save carrfane/b209263df2bd09031ebf3bc4ded4ed2c to your computer and use it in GitHub Desktop.
Mirage Config File
import config from 'verto-client-dashboard/config/environment';
export default function() {
this.urlPrefix = config.general.backendHost;
this.namespace = config.general.namespace;
this.get('/image-collections');
this.get('/image-collections/:id');
this.post('/image-collections', function({ imageCollections }, request) {
return {}
}, 200);
// request to upload on backend
this.post('/uploads', function() {
return { url: 'http://fakeimage/image.png' }
}, 200);
this.get('https://btb.eu.auth0.com/authorize?client_id=kJYCQvPD25gLwREDS2gx9TNTwr84AAwQ&connection=facebook&redirect_uri=http%3A%2F%2Flocalhost%3A3010%2Foauth_callbacks&response_type=code&state=AXtQLp5UmhHBUfu4xp2Sf03CkV0JQ3LY&scope=openid%20profile%20email&auth0Client=eyJuYW1lIjoiYXV0aDAuanMiLCJ2ZXJzaW9uIjoiOS4xMS4zIn0%3D')
// These comments are here to help you get started. Feel free to delete them.
/*
Config (with defaults).
Note: these only affect routes defined *after* them!
*/
// this.urlPrefix = ''; // make this `http://localhost:8080`, for example, if your API is on a different server
// this.namespace = ''; // make this `/api`, for example, if your API is namespaced
// this.timing = 400; // delay for each request, automatically set to 0 during testing
/*
Shorthand cheatsheet:
this.get('/posts');
this.post('/posts');
this.get('/posts/:id');
this.put('/posts/:id'); // or this.patch
this.del('/posts/:id');
https://www.ember-cli-mirage.com/docs/route-handlers/shorthands
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment