add authed method
This commit is contained in:
parent
d2bc7d5dd4
commit
f01ecdf5a8
@ -74,13 +74,22 @@ class API {
|
||||
} = request;
|
||||
if (!method)
|
||||
return cb({
|
||||
error: "method missed"
|
||||
error: "method missed",
|
||||
ended: true
|
||||
});
|
||||
if (!trace_id)
|
||||
return cb({
|
||||
error: "trace_id missed"
|
||||
error: "trace_id missed",
|
||||
ended: true
|
||||
});
|
||||
return this.methods[method]?.(connection, request, cb);
|
||||
const selmethod = this.methods[method];
|
||||
if (selmethod === undefined)
|
||||
return cb({
|
||||
error: "unknown method: " + method,
|
||||
trace_id,
|
||||
ended: true
|
||||
});
|
||||
return selmethod(connection, request, cb);
|
||||
} else {
|
||||
return cb({
|
||||
error: "required JSON-object based request"
|
||||
|
@ -1,4 +1,4 @@
|
||||
module.exports = function (con, req, cb) {
|
||||
return cb({ error: "At develop" });
|
||||
return cb({ error: "At develop", trace_id: req.trace_id, ended: true });
|
||||
//;
|
||||
};
|
Loading…
Reference in New Issue
Block a user