Configuration

  1. Add information about destination in config file

#data/app.config.yaml
version: v1.3
type: Config
body:
  proxy:
    - name: local
      url: http://localhost:9080
  1. Create proxy manifest

#data/proxy-example.yaml
version: v1.2
type: Proxy
rules:
  - request:                    
      path: /api/greetings/**
    proxy-name: local           

Explanation

With these settings, request GET /api/greetings to httpstub will redirect traffic to http://localhost:9080 under hood. Since path-matching spring is used here, all requests that start with /api/greetings will be redirected to the upstream:

  • /api/greetings/details

  • /api/greetings/details/reports

  • /api/greetings/details/reports/view/1

All them will be redirected to http://localhost:9080

Last updated