removed proxy pass

This commit is contained in:
Timo Bejan 2020-11-12 21:54:08 +02:00
parent 9a0e354faa
commit cf69267bdc
8 changed files with 23 additions and 127 deletions

View File

@ -74,8 +74,7 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "red-ui:build",
"proxyConfig": "apps/red-ui/proxy.conf.json"
"browserTarget": "red-ui:build"
},
"configurations": {
"production": {

View File

@ -1,80 +0,0 @@
{
"/project": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/reanalyze": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/upload": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/version": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/viewedPages": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/redactionLog": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/user": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/download": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/delete": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/status": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/dictionary": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/manualRedaction": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/color": {
"target": "https://timo-redaction-dev.iqser.cloud/",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}

View File

@ -23,6 +23,7 @@ export class AppConfigService {
loadAppConfig(): Observable<any> {
return this._httpClient.get<any>('/assets/config/config.json').pipe(
tap((config) => {
console.log('got', config);
this._config = config;
})
);

View File

@ -30,7 +30,6 @@ export function keycloakInitializer(keycloak: KeycloakService, appConfigService:
},
enableBearerInterceptor: true
};
console.log(options);
return keycloak.init(options);
});
};

View File

@ -1,13 +1,28 @@
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { AppConfigService } from '../app-config/app-config.service';
import { AppConfigKey, AppConfigService } from '../app-config/app-config.service';
@Injectable()
export class ApiPathInterceptorService implements HttpInterceptor {
constructor(private readonly _appConfigService: AppConfigService) {}
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(req);
if (!req.url.startsWith('/assets')) {
console.log(this._appConfigService);
const updatedRequest = req.clone({
url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url
});
return next.handle(updatedRequest);
} else {
// if (!req.url.startsWith('/assets')) {
// const updatedRequest = req.clone({
// url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url
// })
// return next.handle(updatedRequest);
// } else {
return next.handle(req);
}
// }
}
}

View File

@ -1,6 +1,6 @@
{
"OAUTH_URL": "https://redkc-staging.iqser.cloud/auth/realms/redaction",
"OAUTH_CLIENT_ID": "redaction",
"API_URL": "",
"API_URL": "https://timo-redaction-dev.iqser.cloud",
"PDFTRON_LICENSE": ""
}

View File

@ -1,5 +1,5 @@
server {
upload_progress proxied 1m;
listen 8080;
proxy_hide_header WWW-Authenticate;
root /usr/share/nginx/html;
@ -15,45 +15,7 @@ server {
proxy_hide_header WWW-Authenticate;
try_files $uri$args $uri$args/ $uri $uri/ /index.html =404;
}
location /project {
proxy_pass $API_URL;
}
location /viewedPages {
proxy_pass $API_URL;
}
location /version {
proxy_pass $API_URL;
}
location /color {
proxy_pass $API_URL;
}
location /user {
proxy_pass $API_URL;
}
location /dictionary {
proxy_pass $API_URL;
}
location /manualRedaction {
proxy_pass $API_URL;
}
location /reanalyze {
proxy_pass $API_URL;
}
location /upload {
proxy_pass $API_URL;
}
location /download {
proxy_pass $API_URL;
}
location /delete {
proxy_pass $API_URL;
}
location /status {
proxy_pass $API_URL;
}
location /redactionLog {
proxy_pass $API_URL;
}
client_max_body_size 0;
gzip_min_length 1000;
gzip on;

View File

@ -2,7 +2,7 @@ export const APP_LEVEL_CACHE = 'app-level-cache';
export const DYNAMIC_CACHES = [
{
urls: ['/assets/'],
urls: ['/assets/icons', '/assets/wv-resources'],
name: 'cached-assets',
maxAge: 24 * 3600,
maxSize: 1000,