ng-mocker
10 seconds to build virtual interfaces in angular.
Enjoy
My sister was still in primary school, but it took her only 1 minutes to learn how to use it. It's too simple.
- import:
install: npm i --save ng-mocker
// in app.module.ts
import { MockerModule } from 'ng-mocker'
// ...
imports: [
HttpClientModule,
MockerModule.forRoot(Mocks),
],
- create your api:
export class Mocks {
host: string = 'http://github.com'
'/users/options'(req): any {
return { message: 'ok!' }
}
}
when you request
/users/optionswith angular,{ message: 'ok!' }will be returned.