Last active
March 28, 2019 10:28
-
-
Save 4skinSkywalker/a3c350d3959ad43a7a4755809c792e1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { InMemoryDbService } from 'angular-in-memory-web-api'; | |
import { RequestInfo } from 'angular-in-memory-web-api/interfaces'; | |
export class MyInMemoryService implements InMemoryDbService { | |
// In-Memory DB will intercept /api/whatever calls and return data | |
createDb() { | |
const customers = [ | |
{ id: 1, username: 'fred92', password: '1234' }, | |
{ id: 2, username: 'john69', password: 'abcd' }, | |
// add as many data you need | |
] | |
const products = [ | |
{ id: 1, maker: 'Samsung', model: 'Galaxy'}, | |
{ id: 2, maker: 'Sony', model: 'Xperia'} | |
] | |
return { customers, products } // add as many end-points you want | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment