0.0.11 • Published 6 years ago

nz-ng2-interceptors v0.0.11

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

nz-ng2-interceptors

Build Status codecov

About

This package contains recommended interceptors to use in your app.

Installation

npm install nz-ng2-interceptors --save

in your module add the interceptors you need

@NgModule({
    imports: [
        CsrfModule.withOptions(),
        TokenAuthenticationModule.withOptions({
          tokenStoredIn: TokenStorages.cookies,
          tokenKeyName: environment.tokenCookieName
        }),
        DecorateRequestModule.withOptions({
          params: {format: 'json'},
          headers: {
            'Content-Type': 'application/json'
          },
          url: environment.serverUrl
        }),
    ]
})

License

MIT