{"name":"static-router","version":"1.0.1","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.9.1","connect":"^3.0.2","mkdirp":"^0.5.0","mocha":"^1.20.1","rmdir":"^1.0.4","supertest":"^0.13.0"},"dependencies":{"deliver":"^1.1.0","directory-index":"^0.1.0","fast-url-parser":"^1.0.6-0","file-exists":"^0.1.0","globject":"^0.1.3","mime-types":"^1.0.1","minimatch":"^0.4.0","slasher":"^0.1.5"},"gitHead":"02aaed1b9cd948d4c467bf963da3fb3b8c01f280","_id":"static-router@1.0.1","_shasum":"cbe542bec19f32b774e6a4f0bd592267d5ce0843","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"cbe542bec19f32b774e6a4f0bd592267d5ce0843","tarball":"http://registry-npm.ywwl.com/static-router/download/static-router-1.0.1.tgz","integrity":"sha512-3lIT/rVeNJFqnfw4oj0db6uJdHb1celVDYmYyI3bNuPY2Ijg9wjZLQ85qBPYnm0ZtChLFLuA8rQ+VcfE7s7Etg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGSmOdkXGuMlPDSKVtU3jgBZJTGWK1/NVqflQcx45A2AiEArC1aUs/biHIOCXFkP6KXYQqnqx4YXMhyco8XUezA9Uw="}],"size":3107,"noattachment":false,"key":"/static-router/-/static-router-1.0.1.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":1410971710441,"_cnpm_publish_time":1410971710441,"dist-tags":{"latest":"1.1.0"}}