Improve Http Request

This commit is contained in:
kevinpauer
2022-03-28 00:37:49 +02:00
parent 0393f153bf
commit e9f1e7d38a
8 changed files with 102 additions and 27 deletions

View File

@@ -7,7 +7,7 @@ import {
} from '@angular/common/http';
import { TokenStorageService } from '../Services/token.service';
import { Observable } from 'rxjs';
const TOKEN_HEADER_KEY = 'Authorization'; // for Spring Boot back-end
const TOKEN_HEADER_KEY = 'Authorization';
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
constructor(private token: TokenStorageService) {}

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { HelperService } from './helper.service';
describe('HelperService', () => {
let service: HelperService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(HelperService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,10 @@
import { Injectable } from '@angular/core';
import { Stock } from '../Models/stock.model';
@Injectable({
providedIn: 'root'
})
export class HelperService {
constructor() { }
}