dhigginbotham / restify-nedb Goto Github PK
View Code? Open in Web Editor NEWrestful routes for nedb w/ simple garbarge collection
Home Page: http://dhigginbotham.github.io/restify-nedb
License: MIT License
restful routes for nedb w/ simple garbarge collection
Home Page: http://dhigginbotham.github.io/restify-nedb
License: MIT License
slightly trivial if the main use will be for caching on authenticated requests, however that's only one use case -- I'd like to add something like:
new nedb {
# ... other nedb extended settings
exclude: ['stale','someOther']
}, app
Just saw the code about disabling version option, it should be able to turn version option off by setting version = false
However, the code seems not functioning in:
https://github.com/dhigginbotham/restify-nedb/blob/master/lib/mount.js#L22
The condition will always be fulfilled, and this.version in the resulting uri regardless of its value:
uri = util.format((this.version != null) || this.version !== false ? this.prefix + this.version : this.prefix);
Should it be something like this?
uri = util.format((this.version != null) && this.version !== false ? this.prefix + this.version : this.prefix);
The source of my test app is here: https://gist.github.com/dukedougal/9edb1e4fd525271c57c0
Here is the output of trying to use the restify-nedb API:
ubuntu@ugbuildserver:$ curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:1337/kernel$ curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:1337
Cannot POST /kernel
ubuntu@ugbuildserver:
Cannot POST /
ubuntu@ugbuildserver:$ curl -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:1337/kernel$ curl -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:1337/kernel
Cannot POST /kernel
ubuntu@ugbuildserver:
Cannot POST /kernel
ubuntu@ugbuildserver:$ curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:1337$ curl --verbose http://localhost:1337
Cannot POST /
ubuntu@ugbuildserver:
< HTTP/1.1 404 Not FoundGET / HTTP/1.1
User-Agent: curl/7.38.0
Host: localhost:1337
Accept: /
C:\nodejs\node_modules\restify>npm install restify-nedb --save
npm WARN unmet dependency C:\nodejs\node_modules\npm\node_modules\npm-registry-c
lient\node_modules\couch-login requires request@'~2.9.202' but will load
npm WARN unmet dependency C:\nodejs\node_modules\npm\node_modules\request,
npm WARN unmet dependency which is version 2.42.0
[email protected] ..\restify-nedb
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], underscore
@1.4.4)
Trying to run node example.js
C:\nodejs\node_modules\restify>node example.js
C:\nodejs\node_modules\restify\example.js:29
cfg.makeDataStore();
^
TypeError: Object [object Object] has no method 'makeDataStore'
at Object. (C:\nodejs\node_modules\restify\example.js:29:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
I am getting the following errors:
express deprecated req.param(name): Use req.params, req.body, or req.query instead node_modules/restify-nedb/lib/crudify.js:14:14
express deprecated req.param(name): Use req.params, req.body, or req.query instead node_modules/restify-nedb/lib/crudify.js:18:17
express deprecated req.param(name): Use req.params, req.body, or req.query instead node_modules/restify-nedb/lib/crudify.js:19:16
express deprecated req.param(name): Use req.params, req.body, or req.query instead node_modules/restify-nedb/lib/crudify.js:20:16
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.