File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const filter = function ( pathname , req ) {
2- return req . method === 'GET' && pathname . match ( '^/(index\.html)?$' )
3- } ;
4-
51const LOCAL_IP = '127.0.0.1' ;
62
3+ const backend = [
4+ "/api" ,
5+ "/storages"
6+ ] ;
7+
78const PROXY_CONFIG = [
89 {
9- context : filter ,
10+ // don't forward when path matches /static/assets or backend endpoints to prevent infinity loop.
11+ context : function ( pathname ) {
12+ const ignored = [ "/static/assets" , ...backend ] . join ( "|" ) . replace ( / \/ / g, "\\/" ) ;
13+ const matchesIgnored = new RegExp ( `^${ ignored } ` ) . test ( pathname ) ;
14+ return matchesIgnored === false ;
15+ } ,
1016 target : `http://${ LOCAL_IP } :4200/static/assets` ,
1117 secure : false ,
12- logLevel : "debug "
18+ logLevel : "info "
1319 } ,
1420 {
15- context : [
16- "/api" ,
17- "/storages"
18- ] ,
21+ context : backend ,
1922 target : `http://${ LOCAL_IP } :48080` ,
2023 secure : false ,
21- logLevel : "debug " ,
24+ logLevel : "info " ,
2225 changeOrigin : true
2326 }
2427] ;
2528
29+ console . log ( ) ;
30+ console . log ( '\x1b[35m%s\x1b[0m' , 'Note: You need to have a running Strongbox instance for the UI to work!' ) ;
31+ console . log ( "https://strongbox.github.io/developer-guide/building-strongbox-using-strongbox-instance.html#starting-a-strongbox-instance" ) ;
32+ console . log ( ) ;
33+ console . log ( ) ;
34+ console . log ( ) ;
35+
2636module . exports = PROXY_CONFIG ;
You can’t perform that action at this time.
0 commit comments