Merge pull request #1563 from spotify/shmidt-i/proxy-plugin

Proxy backend plugin
This commit is contained in:
Ivan Shmidt
2020-07-13 15:02:06 +02:00
committed by GitHub
17 changed files with 342 additions and 11 deletions
+1
View File
@@ -18,6 +18,7 @@
"migrate:create": "knex migrate:make -x ts"
},
"dependencies": {
"@backstage/plugin-proxy-backend": "^0.1.1-alpha.13",
"@backstage/backend-common": "^0.1.1-alpha.13",
"@backstage/catalog-model": "^0.1.1-alpha.13",
"@backstage/config": "^0.1.1-alpha.13",
+4 -1
View File
@@ -36,6 +36,7 @@ import identity from './plugins/identity';
import rollbar from './plugins/rollbar';
import scaffolder from './plugins/scaffolder';
import sentry from './plugins/sentry';
import proxy from './plugins/proxy';
import techdocs from './plugins/techdocs';
import { PluginEnvironment } from './types';
@@ -65,6 +66,7 @@ async function main() {
const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder'));
const authEnv = useHotMemoize(module, () => createEnv('auth'));
const identityEnv = useHotMemoize(module, () => createEnv('identity'));
const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs'));
const service = createServiceBuilder(module)
@@ -83,7 +85,8 @@ async function main() {
)
.addRouter('/auth', await auth(authEnv))
.addRouter('/identity', await identity(identityEnv))
.addRouter('/techdocs', await techdocs(techdocsEnv));
.addRouter('/techdocs', await techdocs(techdocsEnv))
.addRouter('/proxy', await proxy(proxyEnv));
await service.start().catch(err => {
console.log(err);
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @ts-ignore
import { createRouter } from '@backstage/plugin-proxy-backend';
import { PluginEnvironment } from '../types';
export default async function createPlugin({
logger,
config,
}: PluginEnvironment) {
return await createRouter({ logger, config });
}