Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NijiDigital/mockiji-proxy-middleware

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mockiji-Proxy-Middleware

A basic proxy middleware for Mockiji.

Usage

const Mockiji = require('mockiji');

const server = new Mockiji({
  configuration: {
    middlewares: [
      require('mockiji-proxy-middleware')({
        checkMockStatus: true,
        paths: {
          '/api/test/book/.*': 'my-books-api.local',
          '/api/test/user/[0-9]+': '127.0.0.1:8083',
        },
      })
    ]
  }
});

server.start();

Parameters

Name Default Description
checkMockStatus true If set to true proxying will only happen if Mockiji could not find a mock file matching the request
timeout 60 Timeout in seconds for proxied requests
paths {} An object in which keys are regular expressions and values are the hosts the requests should be redirected to

About

A basic proxy middleware for Mockiji

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.