krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.

Home Page:https://www.krakend.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to configure Krakend to support Upload File Endpoint

AnandThurubatla opened this issue · comments

Hello Community Members,

We have been using KrakenD as API Gateway for our Micro-Services. One of our micro-service handles Image upload. We tried in ways to configure KrakenD to support upload Image in Base64 format and binary but no luck. Not found any references too.

Can some one share KrakenD configuration which supports Image upload?

Thanks,
Anand

Hello Anand,

You could start here:

  "endpoint": "/some-file-upload",
  "method": "POST",
  "output_encoding": "no-op",
  "input_headers": ["*"],
  "backend": [
    {
      "url_pattern": "/service/some-file-upload",
      "encoding": "no-op",
      "method": "POST",
      "host": ["http://yourmicorservice"]
    }
  ]
}

Notice the no-op because you don't want KrakenD to encode/decode, and also the input_headers because most microservices rely on specific headers for file upload. Use this until you are certain of which ones you need.

Share logs for further help