Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

A body modifier plugin for Express Gateway

Notifications You must be signed in to change notification settings

XVincentX/express-gateway-plugin-body-modifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-gateway-plugin-body-modifier

Warn

This policy has been modified and it's not included in Express Gateway core. Check that out!

Introduction

This plugin for Express Gateway makes it possible rewrite request and response body before these get proxied to the target serviceEndpoint or returned back to the client

Installation

Simply type from your shell environment:

eg plugin install express-gateway-plugin-body-modifier

Quick start

  1. Make sure the plugin is listed in system.config.yml file. This is done automatically for you if you used the command above.

  2. Add the configuration keys to gateway.config.yml file.

policies:
  - body-modifier:
      action:
        request:
          add:
          - name: fullname
            value: req.body.name + ' ' + req.body.surname
          remove:
          - name
          - surname
        response:
          add:
          - name: createdBy
            value: "'Clark Kent'"
          remove:
          - uselessParam

Want to make your own plugin?

Just check out our plugin development guide. We can't wait to see your custom stuff in the Gateway!

About

A body modifier plugin for Express Gateway

Resources

Stars

Watchers

Forks

Packages

No packages published