fix development server proxy

This commit is contained in:
2020-10-17 14:27:54 +02:00
parent 2cdc9813da
commit e15b16a65f
3 changed files with 18 additions and 5 deletions

View File

@@ -1,9 +1,21 @@
{ {
"/": { "/assets": {
"target": "http://localhost:17333", "target": "http://localhost:17333",
"secure": false, "secure": false,
"pathRewrite": {"^/foobar" : ""}, "pathRewrite": {"^/foobar" : ""},
"changeOrigin": true, "changeOrigin": true,
"logLevel": "debug" "logLevel": "debug"
},
"/api": {
"target": "http://localhost:17333",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/img-generated": {
"target": "http://localhost:17333",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
} }
} }

View File

@@ -40,7 +40,7 @@ export class PlotService {
} }
getTagFields(): Observable<Array<string>> { getTagFields(): Observable<Array<string>> {
return this.http.get<Array<string>>('//'+window.location.hostname+':'+window.location.port+'/fields'); return this.http.get<Array<string>>('//'+window.location.hostname+':'+window.location.port+'/api/fields');
} }
autocomplete(query: string, caretIndex: number, resultMode: ResultMode): Observable<AutocompleteResult> autocomplete(query: string, caretIndex: number, resultMode: ResultMode): Observable<AutocompleteResult>
@@ -51,17 +51,17 @@ export class PlotService {
.set('query', query) .set('query', query)
.set('resultMode', resultMode) .set('resultMode', resultMode)
}; };
return this.http.get<AutocompleteResult>('//'+window.location.hostname+':'+window.location.port+'/autocomplete', options); return this.http.get<AutocompleteResult>('//'+window.location.hostname+':'+window.location.port+'/api/autocomplete', options);
} }
sendPlotRequest(plotRequest: PlotRequest): Observable<PlotResponse>{ sendPlotRequest(plotRequest: PlotRequest): Observable<PlotResponse>{
//console.log("send plot request: "+ JSON.stringify(plotRequest)); //console.log("send plot request: "+ JSON.stringify(plotRequest));
return this.http.post<PlotResponse>('//'+window.location.hostname+':'+window.location.port+'/plots', plotRequest); return this.http.post<PlotResponse>('//'+window.location.hostname+':'+window.location.port+'/api/plots', plotRequest);
} }
getFilterDefaults(): Observable<FilterDefaults>{ getFilterDefaults(): Observable<FilterDefaults>{
return this.http.get<FilterDefaults>('//'+window.location.hostname+':'+window.location.port+'/filters/defaults') return this.http.get<FilterDefaults>('//'+window.location.hostname+':'+window.location.port+'/api/filters/defaults')
} }
splitQuery(query: string, splitBy:string) : Observable<Array<string>>{ splitQuery(query: string, splitBy:string) : Observable<Array<string>>{

View File

@@ -60,6 +60,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Controller @Controller
@EnableAutoConfiguration @EnableAutoConfiguration
@RequestMapping(path = "/api")
@CrossOrigin(origins = { "http://localhost:4200", "http://127.0.0.1:4200" }) @CrossOrigin(origins = { "http://localhost:4200", "http://127.0.0.1:4200" })
public class PdbController implements HardcodedValues, PropertyKeys { public class PdbController implements HardcodedValues, PropertyKeys {