{"name":"static-router","version":"1.0.3","description":"Express/Connect middleware to server static files based on glob-like routes.","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/ --reporter dot"},"repository":{"type":"git","url":"git@github.com:divshot/static-router.git"},"keywords":["divshot","superstatic","routes","static","router","static server"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/static-router/issues"},"homepage":"https://github.com/divshot/static-router","devDependencies":{"chai":"^1.10.0","connect":"^3.3.3","mkdirp":"^0.5.0","mocha":"^2.0.1","rmdir":"^1.0.4","supertest":"^0.15.0"},"dependencies":{"deliver":"^1.1.0","directory-index":"^0.1.0","fast-url-parser":"^1.0.6-0","file-exists":"^0.1.0","glob-slash":"^1.0.0","globject":"^1.0.0","mime-types":"^2.0.3","minimatch":"^1.0.0","toxic":"^1.0.0"},"gitHead":"82bf48b8f9a5af2a9933434e6326896ff13ea72c","_id":"static-router@1.0.3","_shasum":"3ccbec8dee310d57d95bc08a80fd2d8f4f09e68b","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.31","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"3ccbec8dee310d57d95bc08a80fd2d8f4f09e68b","tarball":"http://registry-npm.ywwl.com/static-router/download/static-router-1.0.3.tgz","integrity":"sha512-eLAmI5w1pzBRpq5rda6ox0VLeIZ6vUA0Mbqp4GNXd5F0Glq9RM2CyRkU5IiroR7saroKNjYTmLC485Mdq/sPDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHx+LjlHAI5KPSK03+SnYZaUXUPciSNf31wT35Ler5jMCIQClodSPEg0Ujz1/7u+P9t+qfmzPDCN40CqTJvdEI2c3tQ=="}],"size":3218,"noattachment":false,"key":"/static-router/-/static-router-1.0.3.tgz"},"readme":"# static-router\n\nExpress/Connect middleware to server static files based on glob-like routes.\n\n## Install\n\n```\nnpm install static-router --save\n```\n\n## Usage\n\n```js\nvar http = require('http');\nvar connect = require('connect');\nvar router = require('static-router');\n\nvar app = connect();\n\napp.use(router({\n  '**': '/index.html'\n}));\n\nhttp.createServer(app).listen(3000, function () {\n  \n});\n```\n\n**Ensure order of routes**\n\n```js\nvar http = require('http');\nvar connect = require('connect');\nvar router = require('static-router');\n\nvar app = connect();\n\napp.use(router([\n  {'/some-route': '/some-file.html'},\n  {'**': '/index.html'}\n}));\n\nhttp.createServer(app).listen(3000, function () {\n  \n});\n```\n\n### router(routes[, options])\n\n* `routes` - object or array containing globs as keys and target static files and values. Use of an array ensures the order in which the routes are parsed.\n* `options`\n  * `root` - the root directory of the static files.\n  * `index` - name of the default directory index file. Defaults to `index.html`.\n\n## Run Tests\n\n```\nnpm install\nnpm test\n```\n","publish_time":1416346742705,"_cnpm_publish_time":1416346742705,"dist-tags":{"latest":"1.1.0"}}