simple to use nedb cache layer with restful api routing
restify-nedb was built to give you restful api resources for client side application frameworks like
knockout.js as well as give you a simple file/memory based cache utilizing nedb. (ps, i love nedb, you should too.) If you haven't already checked it out, maybe you want to use it separate of all of this extra stuff, do it. It's like sqlite, with a subset of mongodb's api. Really neat.
Let me know if you have any issues, please open issues/prs etc, it's a lot more fun that way
nedbfile/memory backed cache w/ simple garbage collection
"GET", "POST", "PUT", "DELETE"
npm install git+https://github.com/dhigginbotham/restify-nedb --save
express = require "express"app = module.exports = expressnedb = require "restify-nedb"ensure = require "../passport/middleware"prefix: "/session"middleware: ensureadminscache:maxAge: 1000 * 60 * 60app
I would recommend using something like Advanced REST Client for testing, it'll help.
middlewarearray of middleware, defaults to
memory_storedefaults to false
undefinedset a store name
cache.maxAgedefaults to 1hour or
1000 * 60 * 60
dsnot recommended to overwrite, but you have access if you need it..
appendis a Boolean option, if append is
trueyour update appends to the collection, however if it is
falseit will overwrite everything in that doc
The MIT License (MIT)Copyright (c) 2013 David HigginbothamPermission 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 isfurnished to 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 INTHE SOFTWARE.