Skip to content
Snippets Groups Projects
Commit 9bc37bb4 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

added dev proxy config

parent 0a4b0c11
No related branches found
No related tags found
No related merge requests found
Pipeline #5820 failed
...@@ -1678,6 +1678,14 @@ ...@@ -1678,6 +1678,14 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/http-proxy": {
"version": "1.17.5",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.5.tgz",
"integrity": "sha512-GNkDE7bTv6Sf8JbV2GksknKOsk7OznNYHSdrtvPJXO0qJ9odZig6IZKUi5RFGi6d1bf6dgIAe4uXi3DBc7069Q==",
"requires": {
"@types/node": "*"
}
},
"@types/istanbul-lib-coverage": { "@types/istanbul-lib-coverage": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz",
...@@ -7195,14 +7203,32 @@ ...@@ -7195,14 +7203,32 @@
} }
}, },
"http-proxy-middleware": { "http-proxy-middleware": {
"version": "0.20.0", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.20.0.tgz", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.6.tgz",
"integrity": "sha512-dNJAk71nEJhPiAczQH9hGvE/MT9kEs+zn2Dh+Hi94PGZe1GluQirC7mw5rdREUtWx6qGS1Gu0bZd4qEAg+REgw==", "integrity": "sha512-NyL6ZB6cVni7pl+/IT2W0ni5ME00xR0sN27AQZZrpKn1b+qRh+mLbBxIq9Cq1oGfmTc7BUq4HB77mxwCaxAYNg==",
"requires": { "requires": {
"http-proxy": "^1.17.0", "@types/http-proxy": "^1.17.4",
"http-proxy": "^1.18.1",
"is-glob": "^4.0.1", "is-glob": "^4.0.1",
"lodash": "^4.17.14", "lodash": "^4.17.20",
"micromatch": "^4.0.2" "micromatch": "^4.0.2"
},
"dependencies": {
"http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"requires": {
"eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
}
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
}
} }
}, },
"http-signature": { "http-signature": {
...@@ -13733,9 +13759,9 @@ ...@@ -13733,9 +13759,9 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
}, },
"picomatch": { "picomatch": {
"version": "2.2.1", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==" "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"eslint-plugin-flowtype": "^4.6.0", "eslint-plugin-flowtype": "^4.6.0",
"http-proxy-middleware": "^1.0.6",
"moment": "^2.24.0", "moment": "^2.24.0",
"npm": "^6.13.7", "npm": "^6.13.7",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
......
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function (app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://localhost:8000',
changeOrigin: true,
})
);
app.use(
'/admin',
createProxyMiddleware({
target: 'http://localhost:8000',
changeOrigin: true,
})
);
app.use(
'/staticfiles',
createProxyMiddleware({
target: 'http://localhost:8000',
changeOrigin: true,
})
);
app.use(
'/mediafiles',
createProxyMiddleware({
target: 'http://localhost:8000',
changeOrigin: true,
})
);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment