Last active
February 11, 2016 05:14
-
-
Save fabiocav/e2c66433186838a0f2d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
//"read": function (req, res, next) { | |
//} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"get": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"post": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"put": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"patch": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"delete": { | |
"access": "anonymous|authenticated|disabled" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var table = module.exports = require('azure-mobile-apps').table(); | |
// table.read(function (context) { | |
// return context.execute(); | |
// }); | |
// table.read.use(customMiddleware, table.operation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"autoIncrement": false, | |
"read": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"insert": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"update": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"delete": { | |
"access": "anonymous|authenticated|disabled" | |
}, | |
"undelete": { | |
"access": "anonymous|authenticated|disabled" | |
} | |
} |
We're not setting authorize at a table level either as each operation will have this set explicitly
Updated the gist, without the authorize property.
customApi.json:
{
"get": {
"access": "anonymous/authenticated/disabled"
},
"post": {
"access": "anonymous/authenticated/disabled"
},
"put": {
"access": "anonymous/authenticated/disabled"
},
"patch": {
"access": "anonymous/authenticated/disabled"
},
"delete": {
"access": "anonymous/authenticated/disabled"
}
}
customApi.js:
module.exports = {
//"read": function (req, res, next) {
//}
}
schema will be set at the global level - remove this property. I'll add an issue to set the schema from an environment setting.
Custom api templates look good as well
Hi,
I really not understand what does it mean:
// table.read.use(customMiddleware, table.operation);
inside table.js. When I should use it? It's added by default when i create a new 'Easy Table' from the Azure dashboard, but there is not explanation or tutorial. The table.js is not clear. Can you explain me how i can add CRUD operation with a real example?
Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
table.json:
Remember we are not setting dynamic schema on a table level