Scaffolder: HTTP Requests logo

Backstage HTTP request scaffolder actions

Create HTTP requests with the scaffolder

Created by Roadie

Getting started is simple

Don't want to spend your time installing and upgrading Backstage plugins? Get managed Backstage from Roadie.

Installation steps

Install the plugin into Backstage.

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.

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.

We will never sell or share your email address.