feat: make it work

This commit is contained in:
Ivan Shmidt
2020-05-06 17:21:41 +02:00
parent 34d5a985a0
commit bdb02f7de0
7 changed files with 129 additions and 88 deletions
+2 -1
View File
@@ -19,13 +19,14 @@
"dependencies": {
"@backstage/cli": "^0.1.1-alpha.4",
"@backstage/core": "^0.1.1-alpha.4",
"@backstage/plugin-explore": "^0.1.1-alpha.4",
"@backstage/plugin-circleci": "^0.1.1-alpha.4",
"@backstage/plugin-explore": "^0.1.1-alpha.4",
"@backstage/plugin-home-page": "^0.1.1-alpha.4",
"@backstage/plugin-inventory": "^0.1.1-alpha.4",
"@backstage/plugin-lighthouse": "^0.1.1-alpha.4",
"@backstage/plugin-scaffolder": "^0.1.1-alpha.4",
"@backstage/plugin-tech-radar": "^0.1.1-alpha.4",
"@backstage/plugin-test": "^0.1.1-alpha.4",
"@backstage/plugin-welcome": "^0.1.1-alpha.4",
"@backstage/theme": "^0.1.1-alpha.4",
"@material-ui/core": "^4.9.1",
+14 -3
View File
@@ -1,7 +1,18 @@
const { proxySettings } = require('@backstage/plugin-circleci');
const { createProxyMiddleware } = require('http-proxy-middleware');
const createProxyMiddleware = require('http-proxy-middleware');
// FIXME: somehow get it from within the plugin itself?
const circleCIProxySettings = {
'/circleci/api': {
target: 'https://circleci.com/api/v1.1',
changeOrigin: true,
logLevel: 'debug',
pathRewrite: {
'^/circleci/api/': '/',
},
},
};
module.exports = (/** @type {import('express').Application} */ app) =>
Object.entries(proxySettings).forEach(([url, settings]) =>
Object.entries(circleCIProxySettings).forEach(([url, settings]) =>
app.use(url, createProxyMiddleware(settings)),
);