Skip to main content

UNKNOWN

Project description

ynm3k取名自”要你命3000”,目前的功能包括

  • 一个通过完全通过json进行配置的mock调试/反向代理服务器

  • 一个静态文件服务器

安装方法

通过pip安装

sudo pip install ynm3k

基本的使用方法

在8080启动一个mock服务器,根据mock.json的规则进行转发和改写请求

y3k --mock mock.json --port 8080

mock.json的一些例子如下所示:

  • 根据前缀转发请求至不同服务器

    [
      ["/api/", "http://example.com/api/"],
      ["/static/my_work.html", "http://127.0.0.1/static/my_work.html"],
      ["/", "http://192.168.1.10:8080/"]
    ]
  • 改写特殊的请求(POST /test这个请求的结果从文件test.json中返回)

    [
       [
     {
       "type": "exact",
       "path": "/test",
       "method": "POST"
     },
     {
       "type": "file",
       "body": "test.json",
       "headers": {"content-type": "json"}
     }
       ],
       ["/", "http://192.168.1.10:8080/"]
    ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ynm3k-0.1.11.tar.gz (50.6 kB view hashes)

Uploaded Source

Built Distribution

ynm3k-0.1.11-py2.py3-none-any.whl (53.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page