{"_id":"butler","_rev":"18-5f186ea69afa3a94c5d8918c73bfc050","name":"butler","description":"Fully featured static site server","dist-tags":{"latest":"0.4.2"},"versions":{"0.0.1":{"name":"butler","version":"0.0.1","description":"NodeJS Butler","keywords":["butler","async","promisse","future","fiber"],"author":{"name":"Diogo Resende","email":"dresende@thinkdigital.pt","url":"http://www.thinkdigital.pt"},"engines":{"node":">= 0.4.0"},"directories":{"lib":"./lib","example":"./examples"},"main":"./lib/butler","_id":"butler@0.0.1","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.9-pre","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"8fcf19b8d20985a81a5bc6c884d7522eac1663ab","tarball":"https://registry.npmjs.org/butler/-/butler-0.0.1.tgz","integrity":"sha512-g6noHvLkDIP1nfGcveEMiJTObBdAZh1FbKoBqG+9gow+/tJoW85LSBzUa3nPgZ2gr9ei0rSIsNlUepPBO1OEaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzt8iV3gddke6uWwXYvL3MfM4SbXf4+oPqGvLxKNZQ7QIgFwa6qwH2S0e6+LNIVcQXven4IXOKk74tYHpxHv+ak7U="}]},"maintainers":[{"name":"dresende","email":"dresende@thinkdigital.pt"}],"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."},"0.0.2":{"name":"butler","version":"0.0.2","description":"NodeJS Butler","keywords":["butler","async","promisse","future","fiber"],"author":{"name":"Diogo Resende","email":"dresende@thinkdigital.pt","url":"http://www.thinkdigital.pt"},"engines":{"node":">= 0.4.0"},"directories":{"lib":"./lib","example":"./examples"},"main":"./lib/butler","_id":"butler@0.0.2","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.9-pre","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"a5caeea24daa06d02c135e4e298ad73a975d3e4d","tarball":"https://registry.npmjs.org/butler/-/butler-0.0.2.tgz","integrity":"sha512-Vn3y4SDZfMvXvgycB0kfg3f2/bChOYNiX1KeC/LLBG9CeNxwv4+I2FEj2eukr7KDM/4UumutE64GnA2Yz0qdCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7Tkcp33r21HBPr7YIBPnV6LNBSXlz2nCK5j8vZDCLkAiEA1jW7BPqZJWX8m27bKw4P/x/61dbraQLvVEZFbIiL0uc="}]},"maintainers":[{"name":"dresende","email":"dresende@thinkdigital.pt"}],"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."},"0.0.3":{"name":"butler","version":"0.0.3","description":"NodeJS Butler","keywords":["butler","async","promisse","future","fiber"],"author":{"name":"Diogo Resende","email":"dresende@thinkdigital.pt","url":"http://www.thinkdigital.pt"},"engines":{"node":">= 0.4.0"},"directories":{"lib":"./lib","example":"./examples"},"main":"./lib/butler","_id":"butler@0.0.3","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.9-pre","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"e0633e1231de7c9ace911c983d60ef0ce7d43921","tarball":"https://registry.npmjs.org/butler/-/butler-0.0.3.tgz","integrity":"sha512-9jzBL1oshreizqDLC3yX9ZNXW9lRj1wHfuBSGE5eeEQNBdCuEH3ZvyQzdxFD9Mtj7/SFpe0e2a0xMkJyJ0h19g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDk9C+khX48NDYXG/VlQZR4BYPEKgSjTTdy57xZMXbWbAiEAqF2hyO0Phl2lbR4/j5FUxfPrbwbbcqUX8IamVmYtmeU="}]},"maintainers":[{"name":"dresende","email":"dresende@thinkdigital.pt"}],"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."},"0.0.4":{"name":"butler","version":"0.0.4","description":"Fully featured static site server","author":{"name":"Zab"},"license":"MIT","homepage":"http://zab.io","repository":{"type":"git","url":"git+https://github.com/zab/butler.git"},"engines":{"node":">=4"},"keywords":["static","site","server","serve","html5","pushstate","butler","headers","redirect","redirects","proxy","proxies","router","routes","spa","hosting","angular","react","ember","backbone","jumpsuit"],"files":["assets/","bin/","lib/","LICENSE","README.md"],"main":"lib/index.js","bin":{"butler":"bin/butler"},"scripts":{"lint":"exlint src test bin","pretest":"rm -rf .nyc_output coverage && npm run lint","test":"cross-env NODE_ENV=testing nyc ava test -a","posttest":"nyc report -r=lcov","coveralls":"cat coverage/lcov.info | coveralls","build":"rm -rf lib && babel src -d lib --no-comments","watch":"npm run build -- -w -s","prepublish":"npm run build"},"devDependencies":{"ava":"0.14.0","babel-cli":"6.8.0","babel-plugin-transform-runtime":"6.8.0","babel-preset-es2015":"6.6.0","babel-preset-stage-0":"6.5.0","babel-register":"6.8.0","coveralls":"2.11.9","cross-env":"^1.0.7","exlint":"^0.1.3","nyc":"6.4.2"},"dependencies":{"babel-runtime":"6.6.1","body-parser":"1.15.1","compression":"1.6.1","cors":"2.7.1","express":"4.13.4","fs-promise":"0.5.0","helmet":"2.0.0","http-proxy":"1.13.2","lodash":"4.11.2","micromatch":"2.3.8","prerender-node":"2.2.1","serve-static":"1.10.2","source-map-support":"0.4.0","websocket":"1.0.22"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-runtime"]},"ava":{"require":["babel-register"]},"nyc":{"require":["babel-register"],"include":["src"]},"gitHead":"0c8c36a8e6d27d49dfbee3b6e3cae0a06aa8ec7e","bugs":{"url":"https://github.com/zab/butler/issues"},"_id":"butler@0.0.4","_shasum":"ed88b27fe2c7707775e7de2b85e3769f6acfa3f6","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"jsonmaur","email":"j@maur.co"},"dist":{"shasum":"ed88b27fe2c7707775e7de2b85e3769f6acfa3f6","tarball":"https://registry.npmjs.org/butler/-/butler-0.0.4.tgz","integrity":"sha512-F2aW2re7gtmQ7DMhfdWVqg3fCUt6Sm+pE3TWMSlZZg1z3QDecSs8RX+qNXJ0oqO5wSeRwZP171u466xdyvg7rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHyMoKIFa+ojHl1OALkWkcYuphLdcQ15rRBtFAtwzHi0CIQDS40NyZLRBGAun6QWMEmSbulhiOJMA7Yq4SGGJFsYLlw=="}]},"maintainers":[{"name":"dresende","email":"dresende@thinkdigital.pt"},{"name":"jsonmaur","email":"j@maur.co"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/butler-0.0.4.tgz_1463129108099_0.7777448687702417"},"directories":{},"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."},"0.4.0":{"name":"butler","version":"0.4.0","description":"Fully featured static site server","author":{"name":"Zab"},"license":"MIT","homepage":"http://zab.io","repository":{"type":"git","url":"git+https://github.com/zab/butler.git"},"engines":{"node":">=4"},"keywords":["static","site","server","serve","html5","pushstate","butler","headers","redirect","redirects","proxy","proxies","router","routes","spa","hosting","angular","react","ember","backbone","jumpsuit"],"files":["assets/","bin/","lib/","LICENSE","README.md"],"main":"lib/index.js","bin":{"butler":"bin/butler"},"scripts":{"lint":"exlint src test bin","pretest":"rm -rf .nyc_output coverage && npm run lint","test":"cross-env NODE_ENV=testing nyc ava test -a","posttest":"nyc report -r=lcov","coveralls":"cat coverage/lcov.info | coveralls","build":"rm -rf lib && babel src -d lib --no-comments","watch":"npm run build -- -w -s","prepublish":"npm run build"},"devDependencies":{"ava":"0.14.0","babel-cli":"6.8.0","babel-plugin-transform-runtime":"6.8.0","babel-preset-es2015":"6.6.0","babel-preset-stage-0":"6.5.0","babel-register":"6.8.0","coveralls":"2.11.9","cross-env":"^1.0.7","exlint":"^0.1.3","nyc":"6.4.2"},"dependencies":{"babel-runtime":"6.6.1","body-parser":"1.15.1","compression":"1.6.1","cors":"2.7.1","express":"4.13.4","fs-promise":"0.5.0","helmet":"2.0.0","http-proxy":"1.13.2","lodash":"4.11.2","micromatch":"2.3.8","prerender-node":"2.2.1","serve-static":"1.10.2","source-map-support":"0.4.0","websocket":"1.0.22"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-runtime"]},"ava":{"require":["babel-register"]},"nyc":{"require":["babel-register"],"include":["src"]},"gitHead":"dac02736a95f18910db3ed2a5ea217db00d3f360","bugs":{"url":"https://github.com/zab/butler/issues"},"_id":"butler@0.4.0","_shasum":"c6b25eaaaa5646a849b71ce2d6177e942a1d4113","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"jsonmaur","email":"j@maur.co"},"dist":{"shasum":"c6b25eaaaa5646a849b71ce2d6177e942a1d4113","tarball":"https://registry.npmjs.org/butler/-/butler-0.4.0.tgz","integrity":"sha512-68tHU+14gKDMeQNECvxE9swybwhvXUFU4GL6l9FsYEbt5Bpsh7ATXl5T2HJylvmoTtbk0/DveS+GfrHgRuyJEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOYdvLXdxaAZCNRK6h7C+AfCDF5rzPJmvm6GWpGm95xAiBzg9YHGn1OTTzvg2M0Imih6ZMUwoZ3AzlgAfsWcrD07g=="}]},"maintainers":[{"name":"jsonmaur","email":"j@maur.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/butler-0.4.0.tgz_1463167592313_0.9018534037750214"},"directories":{},"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."},"0.4.1":{"name":"butler","version":"0.4.1","description":"Fully featured static site server","author":{"name":"Zab"},"license":"MIT","homepage":"http://zab.io","repository":{"type":"git","url":"git+https://github.com/zab/butler.git"},"engines":{"node":">=4"},"keywords":["static","site","server","serve","html5","pushstate","butler","headers","redirect","redirects","proxy","proxies","router","routes","spa","hosting","angular","react","ember","backbone","jumpsuit"],"files":["assets/","lib/","LICENSE","README.md"],"main":"lib/index.js","bin":{"butler":"lib/bin/butler.js"},"scripts":{"test:lint":"exlint src test bin","test:unit":"nyc ava test/unit -a","test:integration":"ava test/integration","pretest":"rm -rf .nyc_output coverage","test":"cross-env NODE_ENV=testing run-s test:*","posttest":"nyc report -r=lcov","coveralls":"cat coverage/lcov.info | coveralls","prebuild":"rm -rf lib","build":"babel src -d lib --no-comments","watch":"cross-env NODE_ENV=development npm run build -- -w -s","prepublish":"cross-env NODE_ENV=production npm run build"},"devDependencies":{"ava":"0.14.0","babel-cli":"6.9.0","babel-plugin-transform-inline-environment-variables":"6.8.0","babel-plugin-transform-runtime":"6.9.0","babel-preset-es2015":"6.9.0","babel-preset-stage-0":"6.5.0","babel-register":"6.9.0","coveralls":"2.11.9","cross-env":"^1.0.7","exlint":"^0.1.3","npm-run-all":"2.1.1","nyc":"6.4.4","source-map-support":"0.4.0"},"dependencies":{"babel-runtime":"6.9.0","body-parser":"1.15.1","compression":"1.6.2","cors":"2.7.1","express":"4.13.4","fs-promise":"0.5.0","helmet":"2.1.0","http-proxy":"1.13.3","lodash":"4.12.0","micromatch":"2.3.8","serve-static":"1.10.2","websocket":"1.0.23"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-runtime","transform-inline-environment-variables"]},"ava":{"require":["babel-register"]},"nyc":{"require":["babel-register"],"include":["src"]},"gitHead":"298aba17b294fe9e5a3ea0b303fdba80a28e1fe7","bugs":{"url":"https://github.com/zab/butler/issues"},"_id":"butler@0.4.1","_shasum":"17a14f942a1e676b41e44cac4d30edeccb0dfb93","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jsonmaur","email":"j@maur.co"},"dist":{"shasum":"17a14f942a1e676b41e44cac4d30edeccb0dfb93","tarball":"https://registry.npmjs.org/butler/-/butler-0.4.1.tgz","integrity":"sha512-2iTrk0kIWd30wA84Ik31qPrgVT33qtT1MtdeDwnBBWpgzfBJkwQ9/WYeJhiyF4drD6CT/EsqO/AvBfmKptzHMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgHFHOcFvRzQujS2JxP4Hjp89foDgWDXuMnzVvRoM56AIgcZXm0Y3MFeZqHQUcrJVVfGut6drU5YeaURW3zefQ4x8="}]},"maintainers":[{"name":"jsonmaur","email":"j@maur.co"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/butler-0.4.1.tgz_1468036975314_0.9983734695706517"},"directories":{},"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."},"0.4.2":{"name":"butler","version":"0.4.2","description":"Fully featured static site server","author":{"name":"Zab"},"license":"MIT","homepage":"http://zab.io","repository":{"type":"git","url":"git+https://github.com/zab/butler.git"},"engines":{"node":">=4"},"keywords":["static","site","server","serve","html5","pushstate","butler","headers","redirect","redirects","proxy","proxies","router","routes","spa","hosting","angular","react","ember","backbone","jumpsuit"],"files":["assets/","lib/","license","readme.md"],"main":"lib/index.js","bin":{"butler":"lib/bin/butler.js"},"scripts":{"test:lint":"standard --verbose | snazzy","test:unit":"rm -rf .nyc_output coverage && nyc ava test/unit -a","test:integration":"ava test/integration","test:coverage":"nyc report -r=lcov","test":"zoo NODE_ENV=testing run-s test:*","coveralls":"cat coverage/lcov.info | coveralls","build":"rm -rf lib && babel src -d lib --no-comments","watch":"zoo NODE_ENV=development npm run build -- -w -s","prepublish":"zoo NODE_ENV=production npm run build"},"devDependencies":{"ava":"0.16.0","babel-cli":"6.16.0","babel-plugin-transform-inline-environment-variables":"6.8.0","babel-plugin-transform-runtime":"6.15.0","babel-preset-es2015":"6.16.0","babel-preset-stage-0":"6.16.0","babel-register":"6.16.3","coveralls":"2.11.14","npm-run-all":"3.1.0","nyc":"8.3.0","snazzy":"5.0.0","source-map-support":"0.4.3","standard":"8.3.0","zoo":"0.1.9"},"dependencies":{"babel-runtime":"6.11.6","body-parser":"1.15.2","compression":"1.6.2","cors":"2.8.1","express":"4.14.0","fs-promise":"0.5.0","helmet":"2.3.0","http-proxy":"1.15.1","lodash":"4.16.4","micromatch":"2.3.11","serve-static":"1.11.1","websocket":"1.0.23"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-runtime","transform-inline-environment-variables"]},"ava":{"require":["babel-register"]},"nyc":{"require":["babel-register"],"include":["src"]},"gitHead":"827aab8cd3d3c181fcb1e401937a1211d32d79b0","bugs":{"url":"https://github.com/zab/butler/issues"},"_id":"butler@0.4.2","_shasum":"fc98edf05b22b6412afebfb5744b8d29cf5a77f1","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jsonmaur","email":"j@maur.co"},"dist":{"shasum":"fc98edf05b22b6412afebfb5744b8d29cf5a77f1","tarball":"https://registry.npmjs.org/butler/-/butler-0.4.2.tgz","integrity":"sha512-/mcHsU8xs33PFMDAX+AsMwhQ9iIZKmaNtWvJy3SQtso6i+MOHtkJegzNAbgs//utowqj3lsUDpmtUXOif3bw2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIlmkR7YjzJV0OE3uJ1UPEPAXpVH7JBQf0Phh/n6g5cAiBOfmt/ReT8rCzBi7dOlSiOnKCByivi7FEYnCacc69+Nw=="}]},"maintainers":[{"name":"jsonmaur","email":"j@maur.co"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/butler-0.4.2.tgz_1475818639136_0.5061878561973572"},"directories":{},"deprecated":"This package is no longer supported and it's name will be used for another purpose in future versions. If you want to use this package or read the docs, please, visit the repo https://github.com/jsonmaur/butler."}},"maintainers":[{"email":"gmarcuk@gmail.com","name":"gmrchk"}],"time":{"modified":"2022-06-13T05:20:14.423Z","created":"2011-08-11T12:20:34.990Z","0.0.1":"2011-08-11T12:20:35.822Z","0.0.2":"2011-08-11T18:06:55.583Z","0.0.3":"2011-08-11T23:36:00.607Z","0.0.4":"2016-05-13T08:45:09.852Z","0.4.0":"2016-05-13T19:26:32.803Z","0.4.1":"2016-07-09T04:02:56.718Z","0.4.2":"2016-10-07T05:37:21.703Z"},"author":{"name":"Zab"},"keywords":["static","site","server","serve","html5","pushstate","butler","headers","redirect","redirects","proxy","proxies","router","routes","spa","hosting","angular","react","ember","backbone","jumpsuit"],"readme":"# Butler\n\n[![Build Status](https://travis-ci.org/zab/butler.svg?branch=master)](https://travis-ci.org/zab/butler)\n[![Coverage Status](https://coveralls.io/repos/github/zab/butler/badge.svg?branch=master)](https://coveralls.io/github/zab/butler?branch=master)\n\nA fully-featured static server for your sites and apps. Includes support for HTML5 pushState, redirects, custom routes, proxied routes, clean URLs, custom error pages, and more. Butler is the open-sourced version of what powers [Zab](http://zab.io) hosting.\n\n<a name=\"get-started\"></a>\n## Get Started\n\n```bash\n$ npm install butler -g\n  # or if using the module\n$ npm install butler --save\n```\n\nThen go into your project folder, setup your config from the options below, and run\n```bash\n$ butler\n```\n\nYou can also use programmatically by importing the module. This will return a promise, which resolves when the server starts, returning an object with the URI and the server config.\n```javascript\nimport butler from 'butler'\n\nbutler().then((res) => {\n  // res.uri\n  // res.config\n})\n```\n\n> You cannot currently use Butler as middleware in an existing server, but support is coming soon.\n\n<a name=\"config\"></a>\n## Config\n\nYou can customize the behavior of Butler with a file called `butler.config.js` located in the root of your project. The file should export an object using CommonJS like the example below.\n\n```javascript\nmodule.exports = {\n  root: 'dist',\n  // ...\n}\n```\n\n#### Options\n\n- `root` The root folder of your compiled site (where your index.html lives) relative to the directory you run Butler from.\n\n  > Type: `string`  \n  > Default: `dist`\n\n- `port` The port to serve your site on. This will be overridden by the *PORT* environment variable if it is set.\n\n  > Type: `integer`  \n  > Default: `8000`\n\n- `host` The host to serve your site on. This will be overridden by the *HOST* environment variable if set.\n\n  > Type: `string`  \n  > Default: `0.0.0.0`\n\n- `errorPage` Sets a custom 404 error page to use. Butler will serve a default 404 page if you don't specify one. File should be relative to your Butler config file.\n\n  > Type: `string`  \n  > Default: Butler 404 page\n\n- `cleanUrls` Lets you drop `.html` from your URLs (`zab.io/about` instead of `zab.io/about.html`). When a URL with `.html` is requested, we will drop it automatically with a 301 redirect.\n\n  > Type: `boolean`  \n  > Default: `true`\n\n- `pushState` A quick way to enable HTML5 pushState in your server. When enabled, all URLs that are not assets will fallback to `/index.html`. This is a shortcut to defining `/** => /index.html` in your routes.\n\n  > Type: `boolean`  \n  > Default: `false`\n\n- `forceSSL` Forces your site to be accessed over https by redirecting to the secure version of your site. **Only enable this if you have a valid SSL certificate configured on your server!**\n\n  > Type: `boolean`  \n  > Default: `false`\n\n- `redirects` You can specify certain URLs to be redirected to other locations, both internally and externally. This list is prioritized from top to bottom, and whichever route matches first will return. See [Redirects](#redirects) for more info.\n\n  > Type: `array` of `objects`  \n  > Default: `[]`\n\n  - `from` URL to match\n  - `to` URL to redirect to\n  - `type` Redirect code to use. Defaults to `301`.\n\n- `proxies` You can proxy any URL within your site to an external site, whether it's your API, blog, or a site full of kittens. This list is prioritized from top to bottom, and whichever route matches first will return. See [Proxies](#proxies) for more info.\n\n  > Type: `array` of `objects`  \n  > Default: `[]`\n\n  - `src` URL to match\n  - `dest` URL to proxy to\n  - `headers` Array of [headers](#headers)\n\n- `routes` You can specify custom routes for your site, without being limited to your file structure (such as using `aboutUs.html` for `zab.io/about`). This list is prioritized from top to bottom, and whichever route matches first will return. See [Routes](#routes) for more info.\n\n  > Type: `array`  \n  > Default: `[]`\n\n  - `src` URL to match\n  - `dest` File to use for route\n\n- `headers` Allows you to set custom response headers on your site globally or for specific routes. A good use case for this would be adding a CORS configuration. See [Headers](#headers) for more info.\n\n  > Type: `array`  \n  > Default: `[]`\n\n  - `name` Name of your header\n  - `value` Value of your header\n  - `url` Only apply header if URL matches this pattern\n\n<a name=\"redirects\"></a>\n## Redirects\n\nYou can specify certain URLs to be redirected to other locations, both internally and externally. This list is prioritized from top to bottom, and whichever route matches first will return. Supports [segments](#segments) to carry over values from the original URL, as well as [splats](#splats) for wildcards. You can also redirect to external sites by using an absolute url.\n\n```javascript\nredirects: [\n  { from: '/old/path', to: '/new/path' }, // basic redirect\n  { from: '/old/path', to: '/new/path', type: 302 }, // setting redirect type\n  { from: '/name/:firstName', to: '/path/:firstName' }, // using segments\n  { from: '/google/**', to: 'https://www.google.com/#q=$1' }, // external sites\n]\n```\n\n<a name=\"proxies\"></a>\n## Proxies\n\nProxies are a powerful feature in Butler. They allow you to mask outside URLs behind routes in your site. This is useful to solve issues with CORS, to mask the url of your APIs, and many other things. You can also send custom headers to the destination, following the same structure as [headers](#headers). This list is prioritized from top to bottom, and whichever route matches first will return. Supports [segments](#segments) to carry over values from the original URL, as well as [splats](#splats) for wildcards. We will automatically set the `Host` header to the host of the destination.\n\n```javascript\nproxies: [\n  {\n    src: '/api/**',\n    dest: 'https://api.zab.io/**',\n    headers: [\n      { name: 'x-custom-header', value: 'kittens' },\n    ],\n  },\n]\n```\n\nWith the above example, going to `mysite.com/api/user/12345` will proxy the request to `https://api.zab.io/user/12345`. This is different than a redirect, because visitors will still see the original url with `mysite.com` in their address bar.\n\n<a name=\"routes\"></a>\n## Routes\n\nYou can specify custom routes for your site, without being limited to your file structure (such as using `aboutUs.html` for `zab.io/about`). Supports [segments](#segments) to carry over values from the original URL, as well as [splats](#splats) for wildcards. This list is prioritized from top to bottom, and whichever route matches first will return. *Any URL with a file extension other than `.html` will simply bypass the router.*\n\n```javascript\nroutes: [\n  { src: '/about', dest: 'aboutUs.html' },\n  { src: '/contact', dest: 'contact-page.html' },\n]\n```\n\n<a name=\"headers\"></a>\n## Headers\n\nAllows you to set custom response headers on your site globally or for specific routes. A good use case for this would be adding a CORS configuration.\n\n```javascript\nheaders: [\n  { name: 'Access-Control-Allow-Origin', value: '*' },\n  { name: 'X-Special', value: 'Hi', url: '/special/**' }, // only for specific routes\n]\n```\n\n<a name=\"segments\"></a>\n### Segments\n\nSegments are a simple way of carrying over values from the old URL to the new URL. Any piece of your path preceded with `:` is treated as a segment, and will carry over. For example, if you define the redirect `/name/:firstName => /path/:firstName`, going to `yoursite.com/name/jason` will redirect to `yoursite.com/path/jason`.\n\n<a name=\"splats\"></a>\n### Splats\n\nSplats are a simple way of defining wildcards in your URLs. Putting `**` anywhere in your source will allow anything to be matched there. It will also replace whatever the splat covers in the new URL if you include `**` there as well. For example, if you define the redirect `/blog/** => https://medium.com/@jsonmaur/**`, going to `yoursite.com/blog/my-post` will redirect to `https://medium.com/@jsonmaur/my-post`.\n\n<a name=\"license\"></a>\n## License\n\n[MIT](LICENSE) © [Zab Labs](http://zab.io)\n\n<br />\n<p align=\"center\">\n  <a href=\"http://zab.io\">\n    <img src=\"http://cdn.zab.io/logo/icon-50.png\" alt=\"Zab Logo\" />\n  </a>\n</p>\n","readmeFilename":"readme.md","homepage":"http://zab.io","repository":{"type":"git","url":"git+https://github.com/zab/butler.git"},"bugs":{"url":"https://github.com/zab/butler/issues"},"license":"MIT"}