You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
421 B
12 lines
421 B
4 years ago
|
const proxy = require( "http-proxy-middleware" ) ;
|
||
|
|
||
|
module.exports = function( app ) {
|
||
|
// proxy all "/api/..." requests to the Flask backend server
|
||
|
// NOTE: This only applies in the dev environment, production requires nginx proxying to be configured.
|
||
|
app.use( "/api", proxy( {
|
||
|
target: process.env.REACT_APP_FLASK_URL,
|
||
|
pathRewrite: { "^/api/": "/" },
|
||
|
changeOrigin: true,
|
||
|
} ) ) ;
|
||
|
}
|