
Backstage HTTP request scaffolder actions
Create HTTP requests with the scaffolder
Created by Roadie
Get SaaS Backstage
Don't want to spend your time installing and upgrading Backstage plugins? Get managed Backstage from Roadie.
Self-hosted Backstage installation steps
Install the plugin into your scaffolded Backstage application.
cd packages/backend
yarn add @roadiehq/scaffolder-backend-module-http-request
Add http request actions to your scaffolder backend
// packages/backend/src/plugins/scaffolder.ts
const actions = [
createHttpBackstageAction({ config }),
...createBuiltinActions({
containerRunner,
integrations,
config,
catalogClient,
reader,
}),
];
return await createRouter({
containerRunner,
logger,
config,
database,
catalogClient,
reader,
actions,
});
Create template with http actions
...
steps:
- id: backstage_request
name: backstage request
action: http:backstage:request
input:
method: 'GET'
path: '/api/proxy/snyk/org/org/project/project-id/aggregated-issues'
headers:
test: 'hello'
foo: 'bar'
params:
name: 'test'
bar: 'foo'
- id: backstage_request_with_input
name: backstage request
action: http:backstage:request
input:
method: 'POST'
path: '/api/proxy/snyk/org/org/project/project-id/aggregated-issues/get/some/job{{ steps["backstage_request"].output.body.number }}'
headers:
test: 'hello'
foo: 'bar'
body:
name: 'test'
bar: 'foo'
output:
getResponse: '{{ steps["backstage_request_with_input"].output.body }}'
getCode: '{{ steps["backstage_request_with_input"].output.code }}'
getHeaders: '{{ steps["backstage_request_with_input"].output.headers }}'
...
Found a mistake? Update these instructions.
Things to know
This scaffolder action is meant to be used in a scaffolded Backstage application created by Backstage CLI. If you are using it in a Backstage monorepo, you need to modify the build process to transpile node_modules also.
Become a Backstage expert
To get the latest news, deep dives into Backstage features, and a roundup of recent open-source action, sign up for Roadie's Backstage Weekly. See recent editions.