Skip to content

Commit

Permalink
fixed script endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
4ty711 committed Aug 29, 2023
1 parent 01a1cfc commit 7531ad2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
12 changes: 9 additions & 3 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ OBJY.define({
authable: true
})

OBJY.define({
name: "object",
pluralName: "objects"
})

OBJY.client('spoo');

OBJY.object({name: "hello"}).add();


var P = SPOO.REST({
port: 80,
OBJY,
scriptContext: {
objects: function(){console.log(',,,')}
},
extensions: [{
route: '/:entity/:id/property/:propName/call',
authable: true,
Expand Down
8 changes: 5 additions & 3 deletions interface/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,13 @@ Platform = function(SPOO, OBJY, options) {
}

var _context = {
done: done
done: done,
OBJY: OBJY
};

OBJY.client=function(){};
OBJY.useUser=function(){};

Object.assign(_context, options.scriptContext || {});

var script = new vm.Script(script);
Expand All @@ -533,7 +537,6 @@ Platform = function(SPOO, OBJY, options) {
});



router.route(['/client/:client/application'])

.post(checkAuthentication, function(req, res) {
Expand Down Expand Up @@ -930,7 +933,6 @@ Platform = function(SPOO, OBJY, options) {

redis.get('cnt_' + req.body.username, function(err, result) {


if (result !== null) {
if (parseInt(result) >= (options.maxUserSessions || defaultMaxUserSessions)) {
res.status(401)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.9.952"
"version": "0.9.953"
}

0 comments on commit 7531ad2

Please sign in to comment.