Ability to retrieve all (limited to 1000 right now)

This commit is contained in:
KimLS
2017-01-23 00:22:41 -08:00
parent 73bd88dc62
commit e715f5bfa2
2 changed files with 47 additions and 0 deletions
+4
View File
@@ -2,6 +2,10 @@ var auth = require('../../core/jwt_auth.js').auth;
var sql = require('./sql.js');
var RegisterEndpoint = function(app, api, single_name, plural_name, pkey, skeys) {
app.get('/api/data/' + single_name, auth, function (req, res) {
sql.RetrieveAll(req, res, plural_name, pkey);
});
app.get('/api/data/' + single_name + '/:' + pkey, auth, function (req, res) {
sql.Retrieve(req, res, plural_name, pkey);
});