mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
21 lines
616 B
JavaScript
21 lines
616 B
JavaScript
var auth = require('../../core/jwt_auth.js').auth;
|
|
var sql = require('./sql.js');
|
|
|
|
var RegisterEndpoint = function(app, api, endpoint_verb, table_name, pkey) {
|
|
app.get('/api/data/' + endpoint_verb + '/:' + pkey, auth, function (req, res) {
|
|
sql.Retrieve(req, res, table_name, pkey);
|
|
});
|
|
|
|
app.put('/api/data/' + endpoint_verb + '/:' + pkey, auth, function (req, res) {
|
|
sql.CreateUpdate(req, res, table_name, pkey);
|
|
});
|
|
|
|
app.delete('/api/data/' + endpoint_verb + '/:' + pkey, auth, function (req, res) {
|
|
sql.Delete(req, res, table_name, pkey);
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
'Register': RegisterEndpoint
|
|
}
|