{"_id":"@4fun/mockit","_rev":"3-da2699ff093685f18e9cd038f76709ab","name":"@4fun/mockit","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@4fun/mockit","version":"0.1.0","description":"Http API mock for frontend development","main":"index.js","scripts":{"test":"mocha test","start":"node ./src/server.js"},"bin":{"mockit":"cli"},"repository":{"type":"git","url":"git+ssh://git@github.com/seancheung/mockit.git"},"keywords":["http","mock","fake","rest"],"author":{"name":"seancheung","email":"theoxuanx@gmail.com","url":"https://seanz.me"},"license":"MIT","bugs":{"url":"https://github.com/seancheung/mockit/issues"},"homepage":"https://github.com/seancheung/mockit#readme","dependencies":{"@material-ui/core":"^1.4.0","@material-ui/icons":"^1.1.0","axios":"^0.18.0","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-react":"^6.24.1","body-parser":"^1.18.3","brace":"^0.11.1","chokidar":"^2.0.4","css-loader":"^1.0.0","express":"^4.16.3","file-loader":"^1.1.11","js-yaml":"^3.12.0","morgan":"^1.9.0","opener":"^1.5.0","react":"^16.4.1","react-ace":"^6.1.4","react-dom":"^16.4.1","react-redux":"^5.0.7","redux":"^4.0.0","redux-thunk":"^2.3.0","style-loader":"^0.21.0","typeface-roboto":"0.0.54","webpack":"^4.16.1","webpack-dev-middleware":"^3.1.3","yargs-parser":"^10.1.0"},"devDependencies":{"eslint":"^5.1.0","eslint-plugin-react":"^7.10.0"},"gitHead":"aed12d8a6d984bb75338a39f748d65a980c9964c","_id":"@4fun/mockit@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"seancheung","email":"theoxuanx@gmail.com"},"dist":{"integrity":"sha512-secjJ4K9BzyF0hyem0bfAtVLKtjUUDfVyOBoT48qKYDq/rVfPrtthbXe2ErAxFVKNNYzQt7fvWO9KPbRcfKdNA==","shasum":"b7db195563765064794c19ac3db5bdd3f41e416e","tarball":"https://registry.npmjs.org/@4fun/mockit/-/mockit-0.1.0.tgz","fileCount":43,"unpackedSize":98908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbloRqCRA9TVsSAnZWagAAPsMP/0fW8VfBbpg5aOeAJffo\nqQ095fN9jkOSrptqxjEgBUfpQJfDlVaoyL95Dh1vAdQo5AiexCTx66jAh52s\ny7JR/xpb1PkJcEhb3R60q0pCwT+qAwxk5LqMnH5AO7hVhVtNLNNnETfjUzHF\nn27TRKkv9CjMlMYqbp2M+B0+gb8FBkAe1Hld+KXvwk9gLWR8F9RaLCpKYyRD\nrZ+KT5n1i7GiGrUF1DpPRGeZ7Qpw6c4j7H1cSTW/HACP1fuQ83Lf40wOKdn0\nkYt2lBmqWYt0u7gaUFl6YMFhc6iuTudUYUUQrJN/w+vNisdgzuVvdGUZYgPs\nK+PenkDMk5n3VhMicjP7KJHrESgS1+CFMnhyiNUyCx3m32yvDv1+J7xlgMPz\n3CR69CuTrZbJUJukTL/v/KLmG3bqEGjZUTjApJhg6wuKDiMN4A8hND+4ou8v\nVC+2FnNmjOEUAMUM82MEra2hgSjNJZM1dlOqseYghXIqwpKP7RSM1fJgPvX1\n53fLn1anqePipBoAUigTozUiWO9IqwRrM4rPH8cXAyUT5OgdAXaiNYplGsL3\nKcCVcNIKeGxxNR5LOo1jI9d97JDcp2jGTUk57Yec2FvTKopv8muvXLLeGrmQ\nIAN3bDGGL+GbSYI+8oWtlm36wJ5ASpNxxAKkM9VdUpeozUryo/YGHzRJcg3X\nH0ix\r\n=fRrk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDVST9n6ljEuwiNXpXEBYvltzHUW7bPM+IoozfY9ta3BAiEAsgeDyHWMObtfWzbYAIpzCTK6xnwr5bmeCjZvV2BNAxc="}]},"maintainers":[{"name":"seancheung","email":"theoxuanx@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mockit_0.1.0_1536590954213_0.9782812167784454"},"_hasShrinkwrap":false,"deprecated":"Please use mockitjs instead"},"0.1.1":{"name":"@4fun/mockit","version":"0.1.1","description":"Http API mock for frontend development","main":"index.js","scripts":{"test":"mocha test","start":"node ./src/server.js","build":"webpack --config ./client/webpack.config.js --mode=production"},"bin":{"mockit":"cli"},"repository":{"type":"git","url":"git+ssh://git@github.com/seancheung/mockit.git"},"keywords":["http","mock","fake","rest"],"author":{"name":"seancheung","email":"theoxuanx@gmail.com","url":"https://seanz.me"},"license":"MIT","bugs":{"url":"https://github.com/seancheung/mockit/issues"},"homepage":"https://github.com/seancheung/mockit#readme","dependencies":{"body-parser":"^1.18.3","chokidar":"^2.0.4","express":"^4.16.3","js-yaml":"^3.12.0","morgan":"^1.9.0","opener":"^1.5.0","yargs-parser":"^10.1.0"},"devDependencies":{"@material-ui/core":"^1.4.0","@material-ui/icons":"^1.1.0","axios":"^0.18.0","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-react":"^6.24.1","brace":"^0.11.1","clean-webpack-plugin":"^0.1.19","css-loader":"^1.0.0","eslint":"^5.1.0","eslint-plugin-react":"^7.10.0","file-loader":"^1.1.11","html-webpack-plugin":"^3.2.0","react":"^16.4.1","react-ace":"^6.1.4","react-dom":"^16.4.1","react-redux":"^5.0.7","redux":"^4.0.0","redux-thunk":"^2.3.0","style-loader":"^0.21.0","typeface-roboto":"0.0.54","uglifyjs-webpack-plugin":"^1.3.0","webpack":"^4.16.1","webpack-cli":"^3.1.0"},"gitHead":"10467b4d86e0e31f6ef356877aed5b8add3f1b95","_id":"@4fun/mockit@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"seancheung","email":"theoxuanx@gmail.com"},"dist":{"integrity":"sha512-MncG8B+eE79b4tRGyR8SV8GzakFEJtioCIA/rwulItcZX0E6GXb7dn2dcAkLMfIw8otxeGK/Z0alKXd4DFNFag==","shasum":"46bbe415f1aa2a6c2ef88b91a404e332c0e8a437","tarball":"https://registry.npmjs.org/@4fun/mockit/-/mockit-0.1.1.tgz","fileCount":71,"unpackedSize":2354042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJblplfCRA9TVsSAnZWagAAtZYQAIOXcu7F4pc946rySkJA\nhvVCHI3xXGtG2XF+ZYIcoUrQ+UGLvYmU85Hw0TjRwG9QzYBDKqHLAvPFSn/s\nqd/uYZUEMRb6JIApedSQMrWOtMiFnyN2Z5MkEDSVJ3iqb+3NqA4j7BnQZyxg\nwgv2SfHSF2DV2swTy8Kemg1lHFIRORvPkLm0Ntt1WGuFLAXUXF118i4l+iBE\nroILmsPkLr1n8qeiBZ/GyT/Kuk6dKghV9srDgjedb9IbCiOo0UJ2vFlew7Ig\nfEavuSo6wRWTdvfce0M/29Nhr8dwXx8ZcRvngSU6mSHAVcLXIgXjHxfuOQ3c\nwiI7NQQqNpip/YFAiA7ViMQrkBPyUVXRbCVqHx3DDYvGWoJTvzv9wtve6hSZ\nfMLQ9jyuOHY1BfNvQK98RfHGMACnPPep9bQy2sELMCLXB0Kaa+H7U+H0cgxW\nxa6R+9hnWY4sTiGGbAQl5wvBd+NuFdXmWgbBQwdfFzzvnojQr6a+DPAGFHnP\nE1nbu1p3zKn6n8cqCs9d6XJA2hRTrtzsmzcH1Fv2Deosg21jMYWGsdeWwOgx\ny4PyJB6qLzV2/Zc8LAAIh8nD2MZP94F0sodslp/qVwVWAC3FptPGF9LOcSRs\n8HWE2EvYr39Q2bjEJGfhUzgvu7zCKX8lttf+OVL2UJVIMfO0ZrkvJkHKJocG\nqbXk\r\n=kAHy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3Jixmsz7WeYA4kC3UycKpKrPY6a6t2KzMQpp3IL9IfQIgUJZtRMBfEAcBK4Ie3lpV5uoZW1exaWzySRKU3G4NGzQ="}]},"maintainers":[{"name":"seancheung","email":"theoxuanx@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mockit_0.1.1_1536596318870_0.12665709853121498"},"_hasShrinkwrap":false,"deprecated":"Please use mockitjs instead"}},"time":{"created":"2018-09-10T14:49:14.050Z","0.1.0":"2018-09-10T14:49:14.410Z","modified":"2022-04-04T10:46:28.836Z","0.1.1":"2018-09-10T16:18:39.119Z"},"maintainers":[{"name":"seancheung","email":"theoxuanx@gmail.com"}],"description":"Http API mock for frontend development","homepage":"https://github.com/seancheung/mockit#readme","keywords":["http","mock","fake","rest"],"repository":{"type":"git","url":"git+ssh://git@github.com/seancheung/mockit.git"},"author":{"name":"seancheung","email":"theoxuanx@gmail.com","url":"https://seanz.me"},"bugs":{"url":"https://github.com/seancheung/mockit/issues"},"license":"MIT","readme":"# mockit\n\nHttp API mock for frontend development\n\n## Install\n\n```bash\nnpm i -g @4fun/mockit\n```\n\n## Usage\n\n```bash\nmockit -h\n```\n\nOutput:\n\n```text\nUsage: mockit [options] [config]\n\noptions:\n   -H, --host=<host>       host name\n   -P, --port=<port>       port number\n   -S, --ssl               enable https\n       --http2             enable http2\n       --template=<path>   template file path\n       --routes=<path>     routes file path\n       --watch             enable routes file watch\n       --persist=<path>    dump file path\n   -C, --cert=<path>       ssl cert file path\n   -K, --key=<path>        ssl key file path\n   -O, --open              open browser\n       --verbose           output verbose info\n   -h, --help              show this help\n```\n\nQuick start:\n\n```bash\nmockit\n```\n\nStart from config file\n\n```bash\nmockit ./config.yml\nmockit ./config.json\n```\n\n### Config\n\nconfig.yml\n\n```yaml\n# 0.0.0.0 to listen from anywhere\nhost: \"127.0.0.1\"\n# 0 to assign an available port\nport: 0\n# enable http2 support(requires ssl)\nhttp2: false\nssl:\n  # enable ssl support\n  enabled: false\n  cert: \"/path/to/cert/file\"\n  key: \"/path/to/key/file\"\n# enable verbose debug\ndebug: true\n# enable request logging\nlogger:\n  enabled: true\n  # morgan types: combined|common|dev|short|tiny\n  type: \"combined\"\ndashboard:\n  # dashboard base url\n  baseUrl: \"/dashboard\"\n  # template config(object) or path to template file(absolute or relative to this config file)\n  template: \"template.yml\"\nrouter:\n  # enable CORS\n  cors: true\n  # routes config(object) or path to routes file(absolute or relative to this config file)\n  routes: \"routes.yml\"\n```\n\nconfig.json\n\n```json\n{\n  \"host\": \"127.0.0.1\",\n  \"port\": 0,\n  \"http2\": false,\n  \"ssl\": {\n    \"enabled\": false,\n    \"cert\": \"/path/to/cert/file\",\n    \"key\": \"/path/to/key/file\"\n  },\n  \"debug\": true,\n  \"logger\": {\n    \"enabled\": true,\n    \"type\": \"combined\"\n  },\n  \"dashboard\": {\n    \"baseUrl\": \"/dashboard\",\n    \"template\": \"template.yml\"\n  },\n  \"router\": {\n    \"cors\": true,\n    \"routes\": \"routes.yml\"\n  }\n}\n```\n\nroutes.yml\n\n```yaml\n# method and path\nGET /api/v1/account:\n  # bypass(disable) this route\n  bypass: false\n  # simulate response delay in milliseconds\n  delay: 1000\n  # http status code\n  code: 200\n  # response headers\n  headers:\n    Content-Type: \"application/json\"\n    Server: \"Nginx\"\n  # response body(string)\n  body: '{\"name\":\"admin\"}'\nPUT /api/v1/account:\n  bypass: false\n  delay: 0\n  code: 204\n  headers:\n    Content-Type: \"application/json\"\n    Server: \"Nginx\"\n```\n\nroutes.json\n\n```json\n{\n  \"GET /api/v1/account\": {\n    \"bypass\": false,\n    \"delay\": 1000,\n    \"code\": 200,\n    \"headers\": {\n      \"Content-Type\": \"application/json\",\n      \"Server\": \"Nginx\"\n    },\n    \"body\": \"{\\\"name\\\":\\\"admin\\\"}\"\n  },\n  \"PUT /api/v1/account\": {\n    \"bypass\": false,\n    \"delay\": 0,\n    \"code\": 200,\n    \"headers\": {\n      \"Content-Type\": \"application/json\",\n      \"Server\": \"Nginx\"\n    }\n  }\n}\n```\n\ntemplate.yml\n\n```yaml\n# http methods\nmethods:\n  - \"GET\"\n  - \"HEAD\"\n  - \"POST\"\n  - \"PUT\"\n  - \"DELETE\"\n  - \"CONNECT\"\n  - \"OPTIONS\"\n  - \"TRACE\"\n  - \"PATCH\"\n# http status codes and descriptions\ncodes:\n  \"100\": \"Continue\"\n  \"101\": \"Switching Protocols\"\n  \"102\": \"Processing\"\n  \"200\": \"OK\"\n  \"201\": \"Created\"\n  \"202\": \"Accepted\"\n  \"203\": \"Non-Authoritative Information\"\n  \"204\": \"No Content\"\n  \"205\": \"Reset Content\"\n  \"206\": \"Partial Content\"\n  \"207\": \"Multi-Status\"\n  \"208\": \"Already Reported\"\n  \"226\": \"IM Used\"\n  \"300\": \"Multiple Choices\"\n  \"301\": \"Moved Permanently\"\n  \"302\": \"Found\"\n  \"303\": \"See Other\"\n  \"304\": \"Not Modified\"\n  \"305\": \"Use Proxy\"\n  \"306\": \"Switch Proxy\"\n  \"307\": \"Temporary Redirect\"\n  \"308\": \"Permanent Redirect\"\n  \"400\": \"Bad Request\"\n  \"401\": \"Unauthorized\"\n  \"402\": \"Payment Required\"\n  \"403\": \"Forbidden\"\n  \"404\": \"Not Found\"\n  \"405\": \"Method Not Allowed\"\n  \"406\": \"Not Acceptable\"\n  \"407\": \"Proxy Authentication Required\"\n  \"408\": \"Request Timeout\"\n  \"409\": \"Conflict\"\n  \"410\": \"Gone\"\n  \"411\": \"Length Required\"\n  \"412\": \"Precondition Failed\"\n  \"413\": \"Payload Too Large\"\n  \"414\": \"URI Too Long\"\n  \"415\": \"Unsupported Media Type\"\n  \"416\": \"Range Not Satisfiable\"\n  \"417\": \"Expectation Failed\"\n  \"418\": \"I'm a teapot\"\n  \"421\": \"Misdirected Request\"\n  \"422\": \"Unprocessable Entity\"\n  \"423\": \"Locked\"\n  \"424\": \"Failed Dependency\"\n  \"425\": \"Unordered Collection\"\n  \"426\": \"Upgrade Required\"\n  \"428\": \"Precondition Required\"\n  \"429\": \"Too Many Requests\"\n  \"431\": \"Request Header Fields Too Large\"\n  \"444\": \"No Response\"\n  \"449\": \"Retry With\"\n  \"450\": \"Blocked by Windows Parental Controls\"\n  \"451\": \"Unavailable For Legal Reasons\"\n  \"499\": \"Client Closed Request\"\n  \"500\": \"Internal Server Error\"\n  \"501\": \"Not Implemented\"\n  \"502\": \"Bad Gateway\"\n  \"503\": \"Service Unavailable\"\n  \"504\": \"Gateway Timeout\"\n  \"505\": \"HTTP Version Not Supported\"\n  \"506\": \"Variant Also Negotiates\"\n  \"507\": \"Insufficient Storage\"\n  \"509\": \"Bandwidth Limit Exceeded\"\n  \"510\": \"Not Extended\"\n  \"511\": \"Network Authentication Required\"\n# response types\nmime:\n  - \"application/json\"\n  - \"application/x-www-form-urlencoded\"\n  - \"application/xhtml+xml\"\n  - \"application/xml\"\n  - \"multipart/form-data\"\n  - \"text/css\"\n  - \"text/csv\"\n  - \"text/html\"\n  - \"text/json\"\n  - \"text/plain\"\n  - \"text/xml\"\n```\n\ntemplate.json\n\n```json\n{\n  \"methods\": [\n    \"GET\",\n    \"HEAD\",\n    \"POST\",\n    \"PUT\",\n    \"DELETE\",\n    \"CONNECT\",\n    \"OPTIONS\",\n    \"TRACE\",\n    \"PATCH\"\n  ],\n  \"codes\": {\n    \"100\": \"Continue\",\n    \"101\": \"Switching Protocols\",\n    \"102\": \"Processing\",\n    \"200\": \"OK\",\n    \"201\": \"Created\",\n    \"202\": \"Accepted\",\n    \"203\": \"Non-Authoritative Information\",\n    \"204\": \"No Content\",\n    \"205\": \"Reset Content\",\n    \"206\": \"Partial Content\",\n    \"207\": \"Multi-Status\",\n    \"208\": \"Already Reported\",\n    \"226\": \"IM Used\",\n    \"300\": \"Multiple Choices\",\n    \"301\": \"Moved Permanently\",\n    \"302\": \"Found\",\n    \"303\": \"See Other\",\n    \"304\": \"Not Modified\",\n    \"305\": \"Use Proxy\",\n    \"306\": \"Switch Proxy\",\n    \"307\": \"Temporary Redirect\",\n    \"308\": \"Permanent Redirect\",\n    \"400\": \"Bad Request\",\n    \"401\": \"Unauthorized\",\n    \"402\": \"Payment Required\",\n    \"403\": \"Forbidden\",\n    \"404\": \"Not Found\",\n    \"405\": \"Method Not Allowed\",\n    \"406\": \"Not Acceptable\",\n    \"407\": \"Proxy Authentication Required\",\n    \"408\": \"Request Timeout\",\n    \"409\": \"Conflict\",\n    \"410\": \"Gone\",\n    \"411\": \"Length Required\",\n    \"412\": \"Precondition Failed\",\n    \"413\": \"Payload Too Large\",\n    \"414\": \"URI Too Long\",\n    \"415\": \"Unsupported Media Type\",\n    \"416\": \"Range Not Satisfiable\",\n    \"417\": \"Expectation Failed\",\n    \"418\": \"I'm a teapot\",\n    \"421\": \"Misdirected Request\",\n    \"422\": \"Unprocessable Entity\",\n    \"423\": \"Locked\",\n    \"424\": \"Failed Dependency\",\n    \"425\": \"Unordered Collection\",\n    \"426\": \"Upgrade Required\",\n    \"428\": \"Precondition Required\",\n    \"429\": \"Too Many Requests\",\n    \"431\": \"Request Header Fields Too Large\",\n    \"444\": \"No Response\",\n    \"449\": \"Retry With\",\n    \"450\": \"Blocked by Windows Parental Controls\",\n    \"451\": \"Unavailable For Legal Reasons\",\n    \"499\": \"Client Closed Request\",\n    \"500\": \"Internal Server Error\",\n    \"501\": \"Not Implemented\",\n    \"502\": \"Bad Gateway\",\n    \"503\": \"Service Unavailable\",\n    \"504\": \"Gateway Timeout\",\n    \"505\": \"HTTP Version Not Supported\",\n    \"506\": \"Variant Also Negotiates\",\n    \"507\": \"Insufficient Storage\",\n    \"509\": \"Bandwidth Limit Exceeded\",\n    \"510\": \"Not Extended\",\n    \"511\": \"Network Authentication Required\"\n  },\n  \"mime\": [\n    \"application/json\",\n    \"application/x-www-form-urlencoded\",\n    \"application/xhtml+xml\",\n    \"application/xml\",\n    \"multipart/form-data\",\n    \"text/css\",\n    \"text/csv\",\n    \"text/html\",\n    \"text/json\",\n    \"text/plain\",\n    \"text/xml\"\n  ]\n}\n```\n","readmeFilename":"README.md"}