GithubHelp home page GithubHelp logo

adros / pro-xy-auto-responder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zboro/auto-responder

0.0 1.0 0.0 6 KB

Plugin for url-replace. It allows to return local files instead of calling server

JavaScript 100.00%

pro-xy-auto-responder's Introduction

pro-xy-auto-responder

Plugin for pro-xy, that returns file from local filesystem instead of calling server. So that you can simulate response when server is down or you want to change its response and experiment.

Since this plugin provides complete response, no following plugins and replaces are executed if matching auto response is found.

Sample configuration

This plugin is configured in url-replace config file by field "auto-responder".

{
    "port": 8000,
    "logLevel": "INFO",
    "plugins": [
        "pro-xy-auto-responder"
    ],
    "pro-xy-auto-responder": {
		"disabled": false,
		"replaces": [
			{
                "disabled": false,
				"urlPattern": "my/sample/url",
				"target": "sompleFile.txt",
                "method": "GET",
				"status": 200,
                "headers": {
                    "server": "Apache-Coyote/1.1",
                    "expires": "Thu, 01 Jan 1970 00:00:00 GMT",
                    "content-range": "items 0-14/*",
                    "content-type": "application/json;charset=UTF-8"
                }
		    }
		]
	}
}
  • urlPattern - RegExp to be matched by URL
  • status - Status to be set to response
  • method - If specified, auto response will be sent only if request's method matches
  • target - path to file to use as response. Path can be absolute or relative. If path is relative, ".auto-respond" folder in HOME is used to resolve it.
  • headers - map of HTTP headers that will be added to response
  • disabled - disable rule

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.