0

So I have installed my rewrite plugin, but when I try to add it to my gateway.config.yml file, I get this error: Error: data.policies[8] should be string at Config.loadConfig (/home/lovro/SI_ExamProject/gateway/node_modules/express-gateway/lib/config/config.js:55:13) at forEach.type (/home/lovro/SI_ExamProject/gateway/node_modules/express-gateway/lib/config/index.js:12:48) at Array.forEach (<anonymous>) at Object.<anonymous> (/home/lovro/SI_ExamProject/gateway/node_modules/express-gateway/lib/config/index.js:12:25) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17)

This is how my policies look like:

policies: - basic-auth - cors - expression - key-auth - log - oauth2 - proxy - rate-limit - rewrite: - condition: name: pathmatch match: /* action: rewrite: /catering/* redirect: 302

I used this example from official documentation, but it doesnt seem to work. Any ideas?

1 Answers1

0

You should align the hyphen and the key:

  - rewrite:
  - condition:
      name: pathmatch
      match: /*
    action:
      rewrite: /catering/*
      redirect: 302
Jeffrey C
  • 364
  • 4
  • 13