{"_id":"history-server","_rev":"13-93e3476dcd3be48c6540a8d4278580ef","name":"history-server","description":"An HTTP server for single-page apps that use the HTML5 history API","dist-tags":{"latest":"1.3.1"},"versions":{"0.0.1":{"name":"history-server","version":"0.0.1","description":"An HTTP server for single-page apps that use the HTML5 history API","author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./bin/history-server-cli.js"},"dependencies":{"express":"^4.14.0"},"keywords":["history","pushState","html5","express"],"gitHead":"939c337b9731251ad4213885a0b975d9980be36c","_id":"history-server@0.0.1","scripts":{},"_shasum":"46638a6787d5efe469703534d41c0d8d019a30c5","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"46638a6787d5efe469703534d41c0d8d019a30c5","tarball":"https://registry.npmjs.org/history-server/-/history-server-0.0.1.tgz","integrity":"sha512-uy+39EW6NfBLzPc1013bT7seNchPhclL3ACMdaGjYJwBhWqoZC6p/lLT5DGZdAE1nJ269Pxrjh9ukuOHR5Wnmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFoa0YfQ1ovYgcCjPJDFPQSzcGUkgzH21ZVQhxWJIAyFAiEAqb6+sHLaV73NVsaFbzBjEcosTNSSCCV0AaF0kXPJWtg="}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/history-server-0.0.1.tgz_1479187644970_0.3620543899014592"},"directories":{}},"0.1.0":{"name":"history-server","version":"0.1.0","description":"An HTTP server for single-page apps that use the HTML5 history API","repo":"mjackson/history-server","author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./bin/history-server-cli.js"},"dependencies":{"express":"^4.14.0"},"keywords":["history","pushState","html5","express"],"gitHead":"5b4e999035f9bb5d95f560b64a37d56b8363d6dc","_id":"history-server@0.1.0","scripts":{},"_shasum":"f88c30bfd731d4aaf55e92c798cfe382c52c7284","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"f88c30bfd731d4aaf55e92c798cfe382c52c7284","tarball":"https://registry.npmjs.org/history-server/-/history-server-0.1.0.tgz","integrity":"sha512-i1t9yUd6kWCI6/zG2VqUQv7W3qjs99bzbggGeOcC2NT3hBlwO977c6FSCt8zQHW92YaIop513jAve1srNleTlw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBrwZ3/HbS9/vcLMdm2bYBPgRGpe419x/nJjvWGjPv0HAiArlbZBkUI7tO+iOFwpR6YvFsQ+HPYA/PZ4hvnZOgV0ig=="}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/history-server-0.1.0.tgz_1479188367409_0.9911411460489035"},"directories":{}},"0.2.0":{"name":"history-server","version":"0.2.0","description":"An HTTP server for single-page apps that use the HTML5 history API","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"preferGlobal":true,"author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./bin/history-server-cli.js"},"dependencies":{"express":"^4.14.0","glob":"^7.1.1"},"keywords":["history","pushState","html5","express"],"gitHead":"b35fb088fd9d58bb50a1cba92a93142a22e7942e","bugs":{"url":"https://github.com/mjackson/history-server/issues"},"homepage":"https://github.com/mjackson/history-server#readme","_id":"history-server@0.2.0","scripts":{},"_shasum":"4f330d8117fdbaccc9fa22be8f548cca407cde93","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"4f330d8117fdbaccc9fa22be8f548cca407cde93","tarball":"https://registry.npmjs.org/history-server/-/history-server-0.2.0.tgz","integrity":"sha512-qqtxlOR2F1XcsnCjeUX9WgszDu1/We8SzlZQaZ1XgA9vIRG6IEXFkjGtyOeJxL/0qhe+kef71sv8ya5prE7ijw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFd7vB+JC8SODPd62Alx3zTybWdbBn48/6t4wmDVFI7SAiBfPoUFs33mtcpC9VOURMKv3rtQA9aMFirpk4tSmHkHbw=="}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/history-server-0.2.0.tgz_1479240110985_0.8076566820964217"},"directories":{}},"1.0.0":{"name":"history-server","version":"1.0.0","description":"An HTTP server for single-page apps that use the HTML5 history API","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"preferGlobal":true,"author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./bin/history-server-cli.js"},"dependencies":{"express":"^4.14.0","glob":"^7.1.1"},"keywords":["history","pushState","html5","express"],"gitHead":"e1482b325e43247f2d1fa3744159437aaba5b87a","bugs":{"url":"https://github.com/mjackson/history-server/issues"},"homepage":"https://github.com/mjackson/history-server#readme","_id":"history-server@1.0.0","scripts":{},"_shasum":"2f10d27d029e0c45d10d0ed290649497e78b4ae9","_from":".","_npmVersion":"4.0.5","_nodeVersion":"6.6.0","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"2f10d27d029e0c45d10d0ed290649497e78b4ae9","tarball":"https://registry.npmjs.org/history-server/-/history-server-1.0.0.tgz","integrity":"sha512-eBeWWWqjGX6ey9evycOJ2wDvxsTMERcrDHt5tIqW70ZFVtomixBy0i9VpZQ19YMdh63qHrGUl54nNZN2KqrWgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVDn9WQFAMFQ4ivihQnCDCHgTgFA3T7gJMNhoMmX6M5AiBeQHIpYYXTlAunTipItRUrqwuG0+fhbNl+DU4M+5+kDw=="}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/history-server-1.0.0.tgz_1485806168289_0.4636041538324207"},"directories":{}},"1.1.0":{"name":"history-server","version":"1.1.0","description":"An HTTP server for single-page apps that use the HTML5 history API","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"preferGlobal":true,"author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./bin/history-server-cli.js"},"dependencies":{"express":"^4.14.0","glob":"^7.1.1","http-proxy":"^1.16.2"},"keywords":["history","pushState","html5","express"],"gitHead":"61de90fc5175d146ac189984ec2e7e1d21176b14","bugs":{"url":"https://github.com/mjackson/history-server/issues"},"homepage":"https://github.com/mjackson/history-server#readme","_id":"history-server@1.1.0","scripts":{},"_shasum":"905fa670d2d243c9679ba0c3e8b8db3337c7675a","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.1","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"905fa670d2d243c9679ba0c3e8b8db3337c7675a","tarball":"https://registry.npmjs.org/history-server/-/history-server-1.1.0.tgz","integrity":"sha512-27kJVLFQGjP7L5IXb4bSe2LTdCZe8R7yESl9H8hBwF9GCDxuu2gRaltlPolIMN5O717wIjXDmvtud77Eh8mVyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7LBcdQkIq2ezTNRsDsMIqtLb9SwUQ9csZ4Q4hba1QfAiBzVFWi5EwjuQbMLr6+QbeeeMkhm13IunPZbLXtrOX8wQ=="}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/history-server-1.1.0.tgz_1492726198978_0.18523191614076495"},"directories":{}},"1.1.1":{"name":"history-server","version":"1.1.1","description":"An HTTP server for single-page apps that use the HTML5 history API","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"preferGlobal":true,"author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./bin/history-server-cli.js"},"dependencies":{"express":"^4.14.0","glob":"^7.1.1","http-proxy":"^1.16.2"},"keywords":["history","pushState","html5","express"],"scripts":{"start":"node server.js"},"gitHead":"d5f8e18bd72964513bfe52a5fed401f49ce2f76f","bugs":{"url":"https://github.com/mjackson/history-server/issues"},"homepage":"https://github.com/mjackson/history-server#readme","_id":"history-server@1.1.1","_shasum":"c0a403bc492635e71034a5fed1cb45ee755a2992","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.1","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"c0a403bc492635e71034a5fed1cb45ee755a2992","tarball":"https://registry.npmjs.org/history-server/-/history-server-1.1.1.tgz","integrity":"sha512-LDkHXvSY7o9VMf2yVmRHIcfldbomB/O0QTExSU0REy0wbHpkKs0GvTSt1+AKEcUvkP2ZcysbAoLIWSGahUFkPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYqiRDS89DN/RWlVwrOGBcLNrVf3Jef/KfBPw+ou13QAIgWktp+4OU4pMuIESVlVaI1UzHJnttBRe/lRhA73Beocw="}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/history-server-1.1.1.tgz_1492734848482_0.5426807734183967"},"directories":{}},"1.2.0":{"name":"history-server","version":"1.2.0","description":"An HTTP server for single-page apps that use the HTML5 history API","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"preferGlobal":true,"author":{"name":"Michael Jackson"},"license":"MIT","bin":{"history-server":"./history-server.js"},"dependencies":{"express":"^4.14.0","glob":"^7.1.1","http-proxy":"^1.16.2"},"keywords":["history","pushState","html5","express"],"scripts":{"start":"node server.js"},"gitHead":"6be6c7ab32bcc4785aa946e8e6365797ba013cbe","bugs":{"url":"https://github.com/mjackson/history-server/issues"},"homepage":"https://github.com/mjackson/history-server#readme","_id":"history-server@1.2.0","_shasum":"3de89ef830f53006672fbfd538a8301e5b0d370c","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.1","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"dist":{"shasum":"3de89ef830f53006672fbfd538a8301e5b0d370c","tarball":"https://registry.npmjs.org/history-server/-/history-server-1.2.0.tgz","integrity":"sha512-yBj0U6gJJW9OE7K04KMmqPVSDDb3elj18jWUktyIWEFez4HDO2b5XQswYAF4nRZyXIyICjMkjSb9nytJN9mL4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCB5NFXUK4WSXfIiMHZ5QHCuPzwKzidnpAyZvVzwwratAIhAIy8C1fan+PCnoZBVSyxXJSaN4eKegGcfkoYxHeCtaj+"}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/history-server-1.2.0.tgz_1492740151583_0.537106127012521"},"directories":{}},"1.3.1":{"name":"history-server","version":"1.3.1","description":"An HTTP server for single-page apps that use the HTML5 history API","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"preferGlobal":true,"author":{"name":"Michael Jackson"},"license":"MIT","main":"./modules/index.js","bin":{"history-server":"./modules/cli.js"},"files":["modules"],"scripts":{"lint":"eslint modules","test":"npm run lint"},"dependencies":{"express":"^4.14.0","glob":"^7.1.1","http-proxy":"^1.16.2"},"keywords":["history","pushState","html5","express"],"devDependencies":{"eslint":"^4.17.0"},"gitHead":"c880d81e6902321545665fe6d5069cfdf7fdb5ce","bugs":{"url":"https://github.com/mjackson/history-server/issues"},"homepage":"https://github.com/mjackson/history-server#readme","_id":"history-server@1.3.1","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"mjackson","email":"npm@mjackson.me"},"dist":{"integrity":"sha512-P8sDAn5gj54hLTvhV0iagtgKTNIcf8ynn+BC/AjfTGwYXsuhQsinMbCphPJfxCzN10FG7N0c0kX1tdtVkRU3Vw==","shasum":"4d79f1592293f88fd55e5000b4d2a71d713337c0","tarball":"https://registry.npmjs.org/history-server/-/history-server-1.3.1.tgz","fileCount":5,"unpackedSize":9190,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhmtdIn7RlANllk4KA5MIhLmNzlwRc6qd57YJrD9qkCAIhAJf8yaQf0AlT9+9DW8V9UavB2suwCFXuH8cMQl0Fe2gC"}]},"maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/history-server_1.3.1_1518134014509_0.43340271534199126"},"_hasShrinkwrap":false}},"readme":"# history-server [![Travis][build-badge]][build] [![npm package][npm-badge]][npm]\n\n[build-badge]: https://img.shields.io/travis/mjackson/history-server/master.svg?style=flat-square\n[build]: https://travis-ci.org/mjackson/history-server\n[npm-badge]: https://img.shields.io/npm/v/history-server.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/history-server\n\n[`history-server`](https://npmjs.com/package/history-server) is an HTTP server for websites that are composed of many single-page apps (i.e. apps that use the HTML5 `history` API including `history.pushState`, `history.replaceState`, and the `popstate` event). The server is capable of serving many apps from various directories and even different hosts, all from the same domain.\n\n## Installation\n\n    npm install -g history-server\n\n## Usage\n\nThe easiest way to use `history-server` is to point the binary at an `app` directory that contains your `index.html` file.\n\n    $ history-server app\n\nAlternatively, you may serve many apps from the same domain using a directory that contains many apps or a config file (see [Configuration](#configuration) below).\n\n    $ history-server -a apps\n    $ history-server -c config.js\n\nYou may use the following flags:\n\n    -h, --help      Show this help message\n    -a, --apps      The path to a directory that contains many apps\n    -c, --config    The path to a module that exports the server config\n    -p, --port      The port to bind to, defaults to 8080\n\n## Configuration\n\n`history-server` accepts an array of \"apps\" as configuration. Each app is an object of `{ path, root, options, proxy }` where:\n\n* `path` is the URL pattern, i.e. /the/url (required)\n* `root` is the root directory of the app on disk (optional, only for same host)\n* `options` are [`express.static`](http://expressjs.com/en/api.html#express.static) options (optional, only used with `root`)\n* `proxy` is the target URL on another host (e.g. `http://www.example.com/path`) or [an options object](https://github.com/nodejitsu/node-http-proxy#options) to `http-proxy` (optional, for different hosts)\n\nSave your configuration in a module called `config.js`, then start a server with `history-server -c config.js`.\n\n## Simple Configuration on a Single Host\n\nTo serve a single app, just point history-server at a root directory that contains an index.html file to serve at the / URL, using e.g. `history-server app`.\n\nTo serve many apps on the same host, you'll need a way to tell history-server which apps should be served at which URLs. An easy way to do this is to just use the file system to layout your apps like you want your URLs to look.\n\nFor example, consider the following directory tree:\n\n    apps/\n    ├── one\n    │   ├── index.html\n    │   └── index.js\n    └── two\n        ├── index.html\n        ├── index.js\n        └── three\n            ├── index.html\n            └── index.js\n\nYou can use `history-server -a apps` serve all 3 of these apps at the following URLs, in matching order:\n\n    /two/three => apps/two/three\n    /one       => apps/one\n    /two       => apps/two\n\nCare is taken to match the apps with the longest URLs first, because they are the most specific.\n\n## Usage in node\n\n```js\nconst path = require(\"path\");\nconst { createServer } = require(\"history-server\");\n\nconst server = createServer([\n  // Any request that begins with \"/one\" will use apps/one/index.html\n  {\n    path: \"/one\",\n    root: path.resolve(__dirname, \"apps/one\")\n  },\n\n  // Any request that begins with \"/two/three\" will serve apps/two/index.html\n  {\n    path: \"/two/three\",\n    root: path.resolve(__dirname, \"apps/two\")\n  },\n\n  // Any request that begins with \"/two\" will serve apps/two/index.html\n  {\n    path: \"/two\",\n    root: path.resolve(__dirname, \"apps/two\")\n  },\n\n  // Proxies all requests to \"/proxy\" through to another host\n  {\n    path: \"/proxy\",\n    proxy: \"http://www.example.com/path\"\n  }\n]);\n```\n\n## Tips\n\nWhen mounting multiple HTML5 apps on the same domain, you should be sure to:\n\n* **use relative URLs** when you link to resources such as scripts and images, i.e. use `<script src=\"index.js\"></script>` instead of `<script src=\"/index.js\"></script>`. Otherwise your request will go to the root URL instead of your app\n* **use [`<base href>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base)** to specify the base URL to use for all those relative URLs. This should be the `path` of your app with a trailing slash, e.g. `/one/` for an app with a `path` of `/one`\n\nThat's it! Enjoy :)\n","maintainers":[{"name":"mjackson","email":"mjijackson@gmail.com"}],"time":{"modified":"2022-06-18T20:50:53.388Z","created":"2016-11-15T05:27:25.196Z","0.0.1":"2016-11-15T05:27:25.196Z","0.1.0":"2016-11-15T05:39:27.630Z","0.2.0":"2016-11-15T20:01:51.517Z","1.0.0":"2017-01-30T19:56:10.082Z","1.1.0":"2017-04-20T22:10:00.891Z","1.1.1":"2017-04-21T00:34:10.378Z","1.2.0":"2017-04-21T02:02:33.465Z","1.3.0":"2018-02-08T23:28:13.981Z","1.3.1":"2018-02-08T23:53:35.200Z"},"keywords":["history","pushState","html5","express"],"author":{"name":"Michael Jackson"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/mjackson/history-server#readme","repository":{"type":"git","url":"git+https://github.com/mjackson/history-server.git"},"bugs":{"url":"https://github.com/mjackson/history-server/issues"}}