Commit 2ce374cb authored by Simone Vuotto's avatar Simone Vuotto

Move backend url in proxy conf

parent 7adf3207
......@@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng server --proxy-config proxy.conf.json",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
......
{
"/api" :{
"target": "http://localhost:8080/",
"secure": false
}
}
......@@ -5,14 +5,12 @@ import { Observable } from 'rxjs/Observable';
@Injectable()
export class JwtInterceptor implements HttpInterceptor {
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const url = 'http://localhost:8080/';
// add authorization header with jwt token if available
let authorization = localStorage.getItem('currentUser');
if (authorization == null) {
authorization = '';
}
request = request.clone({
url: url + request.url,
setHeaders: {
Authorization: authorization
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment