Skip to content

Add JavaScript example of passthrough #1

@rain1

Description

@rain1

https://github.com/imposter-project/examples/blob/main/rest/passthrough-upstream/imposter-config.yaml

plugin: rest

upstreams:
  example:
    url: https://example.com

resources:
  # forward requests to upstream
  - path: /*
    passthrough: example

  # mock a response
  - path: /mock
    response:
      statusCode: 200
      content: "Hello from a mock"
      headers:
        Content-Type: text/plain

Is there a way to do this in JavaScript? If yes would it possible to add this example? I couldn't figure myself how to do passthrough part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions