feat: move proxy to devserver
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@testing-library/cypress": "^6.0.0",
|
||||
"@types/jquery": "^3.3.34",
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
@@ -15,13 +14,13 @@
|
||||
"cross-env": "^7.0.0",
|
||||
"cypress": "^4.2.0",
|
||||
"eslint-plugin-cypress": "^2.10.3",
|
||||
"http-proxy-middleware": "^1.0.3",
|
||||
"start-server-and-test": "^1.10.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli": "^0.1.1-alpha.4",
|
||||
"@backstage/core": "^0.1.1-alpha.4",
|
||||
"@backstage/plugin-circleci": "^0.1.1-alpha.4",
|
||||
"@backstage/plugin-circleci-backend": "^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",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
const { proxySettings } = require('@backstage/plugin-circleci');
|
||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
|
||||
module.exports = (/** @type {import('express').Application} */ app) =>
|
||||
Object.entries(proxySettings).forEach(([url, settings]) =>
|
||||
app.use(url, createProxyMiddleware(settings)),
|
||||
);
|
||||
@@ -16,7 +16,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/plugin-inventory-backend": "0.1.1-alpha.4",
|
||||
"@backstage/plugin-circleci-backend": "0.1.1-alpha.4",
|
||||
"compression": "^1.7.4",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.17.1",
|
||||
|
||||
@@ -28,7 +28,6 @@ import helmet from 'helmet';
|
||||
import compression from 'compression';
|
||||
import { testRouter } from './test';
|
||||
import { router as inventoryRouter } from '@backstage/plugin-inventory-backend';
|
||||
import { router as circleCIRouter } from '@backstage/plugin-circleci-backend';
|
||||
|
||||
const DEFAULT_PORT = 7000;
|
||||
|
||||
@@ -41,7 +40,6 @@ app.use(compression());
|
||||
app.use(express.json());
|
||||
app.use('/test', testRouter);
|
||||
app.use('/inventory', inventoryRouter);
|
||||
app.use('/circleci', circleCIRouter);
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Listening on port ${PORT}`);
|
||||
|
||||
Reference in New Issue
Block a user