我按照教程在 Azure 上编写了一个脚本,用于自定义 SQL 来检索一些数据: https://www.tapanila.net/windows-azure-mobile-services-custom-api-for-existing-sql-database/
我正在开发移动服务,并在 Azure 上使用“Easy API”。
编写此脚本时出现错误:
exports.get = function(request, response) {
request.service.mssql.query(
'select * from varegrupper', {
success: function(results) {
response.send(200, results);
}
});
};
这是我的错误:
{"error":"Cannot read property 'mssql' of undefined"}
知道我错过了什么吗?
最佳答案
移动服务(现已弃用)和移动应用程序之间存在显着差异。您尝试使用的 API 是移动服务 API,您在其中使用移动应用程序。您可以找到一个带有执行 SQL 语句的自定义 API 的示例项目 here 。您还可以找到一些引用文档here .
关于javascript - Azure 上的 JavaScript 中的 SQL 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37850687/