ExpressGateway / express-gateway

A microservices API Gateway built on top of Express.js
https://www.express-gateway.io
Apache License 2.0
2.97k stars 345 forks source link

stripPath not working #794

Closed johnnywiller closed 6 years ago

johnnywiller commented 6 years ago

Hi, I'm trying to use stripPath to remove path from apiEndpoints. All others path options behave as expected (prependPath and ignorePath).

I'm doing an gateway to RestHeart. When I enter the URL:

http://localhost:8081/api/mongo_collection which points to gateway, I expect redirecting to RestHeart without /api/ path, only the mongo_collection, but RH log keeps saying it's received:

GET http://localhost:8080/api/mongo_collection from /192.168.0.1:45782

Below is my gateway.config.yml

http:
  port: 8081
admin:
  port: 9876
  hostname: localhost
apiEndpoints:
  restheart:
    host: '*'
    path: '/api/*'
serviceEndpoints:
  restheart:
    url: 'http://localhost:8080/'
pipelines:
  default:
    apiEndpoints:
      - restheart
    policies:
      - proxy:
          - action:
              serviceEndpoint: restheart
              changeOrigin: true
              #ignorePath: true  <--- works normal
              #prependPath: true  <--- works normal
              stripPath: true  <--- not working
XVincentX commented 6 years ago

Hey,

thanks for writing us. Unfortunately we had a problem by publishing the documentation for a version which is not yet released — but it's coming really soon (tomorrow). In meantime, you can install the #master branch on your project to get the related stripPath feature. I hope that clarifies!

Feel free to reopen if needed.

johnnywiller commented 6 years ago

Ok, thanks, I'm hoping for the release :).

But just for curiosity, I'm reading doc v1.10.2, which is exactly the same as the latest, and when I do eg --version, it shows 1.10.2. So I think the doc is right, no?

XVincentX commented 6 years ago

It is not unfortunately. The documentation you’re looking at is the one for 1.11.0 :)

I hope to release it tomorrow, in any case not later than next week.

V.

XVincentX commented 6 years ago

@johnnywiller Published.

johnnywiller commented 6 years ago

cool! thanks.