Files
deployd/examples/users/app.dpd
Ritchie Martori 5715c74637 added example apps
2012-06-20 11:28:13 -07:00

1 line
1.3 KiB
Plaintext

{"a8dade7a40ede984":{"properties":{"visited":{"required":false,"type":"date","typeLabel":"date","id":"visited"},"name":{"required":false,"type":"string","typeLabel":"string","id":"name"}},"onGet":"","onPost":"/* Authentication */\n// if (!me || !me.isAdmin) {\n// cancel(\"You must be an admin!\", 401);\n// }\n\n/* Automatic properties */\n// this.creator = me.id;\n// this.creatorName = me.name;\n","onPut":"var visited = new Date(this.visited);\nvar now = new Date().getTime();\n\nif(now - visited < 5000) {\n emit('visit', me.name);\n}","onDelete":"","onValidate":"/* Validation */\n// if (this.name.length < 10) {\n// error(\"name\", \"Must be at least 10 characters\");\n// }\n","path":"/users","order":1,"typeLabel":"Users Collection","type":"UserCollection","$renameFrom":"/users"},"6f27a290f2f4f840":{"properties":{"text":{"required":false,"type":"string","typeLabel":"string","id":"text"}},"onGet":"","onPost":"this.creator = me.name;\nemit('messages changed', this);","onPut":"emit('messages changed', this);","onDelete":"emit('messages changed', this);","onValidate":"/* Validation */\n// if (this.name.length < 10) {\n// error(\"name\", \"Must be at least 10 characters\");\n// }\n","path":"/messages","order":2,"typeLabel":"Collection","type":"Collection"}}