0.0.8 • Published 9 years ago

mock-man v0.0.8

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

Mock Man

What is mock-man about? It is just a node server to response data from local file, ie user.json, then you don't need hard coding in your static files.

Version

  • @0.0.6

Installation

npm install mock-man -g

Configuration

there should be a config file call mocker.json in your root directory

  • mocker.json
{
    "author": "Frend",
    "app": "application name",
    "version": "0.1.0",
    "props": {
        "api": [],
        "port": "3000",
        "base_url": "/User/frend/Document/Frend/GitRepo/FrendEr/mock-man/data/"
    }
}

How to use

  • mockman -h

get help information.

mockman -h

____________________________________________________________
                                                           |
                    help information                       |
                                                           |
____________________________________________________________
                                                           |
Usage: mockman [options]                                   |
                                                           |
  Options:                                                 |
                                                           |
    -h, --help                 output usage information    |
    -V, --version              output the version number   |
    -i, --ip                   output ip address           |
    -a, --api <api url>        set api url                 |
    -p, --path <source path>   set file path               |
    -P, --port <default 3000>  set port, default 3000      |
    -v, --visable              show response on browser    |
                                                           |
____________________________________________________________
  • mockman --ip

get local ip address

mockman --ip

______________________________________________________
                                                     |
               ip address message                    |
                                                     |
______________________________________________________
                                                     |
  IP : 192.168.0.1                                   |
                                                     |
______________________________________________________
  • mockman -p ./data/user.json -P 8080 -v

start a server on port 8080, read local file ./data/user.json and show on the browser.

mockman -p ./data/user.json -P 8080 -v

_________________________________________________________________________
                                                                        |
                      server start message                              |
                                                                        |
_________________________________________________________________________
                                                                        |
 URI : /Users/frend/data/users.json                                     |
PORT : 8080                                                             |
                                                                        |
Server started, listening on port 8080                                  |
You can visit the response datas on browser with http://127.0.0.1:8080  |
                                                                        |
_________________________________________________________________________

License

  • MIT
0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago