added AuthInterceptor for sending api key in the header on every request to api
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { ContactSidebarComponent } from './contact-sidebar/contact-sidebar.component';
|
||||
@@ -10,7 +11,8 @@ import { ProjectsComponent } from './projects/projects.component';
|
||||
import { BlogComponent } from './blog/blog.component';
|
||||
import { ContactComponent } from './contact/contact.component';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { AuthInterceptor } from './http-interceptors/auth.interceptor';
|
||||
import { httpInterceptorProviders } from './http-interceptors';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@@ -29,7 +31,7 @@ import { HttpClientModule } from '@angular/common/http';
|
||||
AppRoutingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [],
|
||||
providers: [httpInterceptorProviders],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
||||
Reference in New Issue
Block a user