miniature in-memory http static middleware optimized for serving buffers or strings
Given a file path, string or buffer, dish will create you an HTTP server request listener, with added benefits:
$ npm install --save dish
To serve a raw string or buffer:
var dish =server =server; // can also accept a Buffer instanceserver;
To serve a file (mime-type autodetected from file name)
You can pass options as the second parameter to
headers(Object) - override / specify headers to send. Be sure to set a
Content-Typeheader if you are serving a string or buffer.
status(Number) - status code for the response, defaults to
By default, dish uses a 256 MB LRU cache to transparently cache files.
dish.cache.setOptions(options). Supports options that lru-cache supports.
- - -### Developed by [Terra Eclipse]()Terra Eclipse, Inc. is a nationally recognized political technology andstrategy firm located in Aptos, CA and Washington, D.C.- - -### License: MIT- Copyright (C) 2012 Carlos Rodriguez ()- Copyright (C) 2012 Terra Eclipse, Inc. ()Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software is furnishedto do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.