Tag: azure mobile services

NodeJS – Google API模块 –

我将nodejs模块“googleapis”( npm install googleapis ) npm install googleapis到Azure移动服务实例,我想用我在https://www.npmjs.org/package/googleapisfind的一些示例代码做一个快速testing。 尝试在谷歌驱动器中创build一个文本文件的代码示例后,我在控制台中得到以下错误信息: [TypeError: Cannot read property 'prototype' of undefined] 错误发生在当前版本的google-api-nodejs-client / apis / index.js的第40行( https://github.com/google/google-api-nodejs-client/blob/master/apis/ index.js ): var Endpoint = require(__dirname + '/' + filename + '/' + path.basename(version)); 在debugging时,我可以看到上面的方法中使用的path如下: D:\home\site\wwwroot\App_Data\config\scripts\node_modules\googleapis\apis\drive\v2 我已经证实path是正确的。 这是我试图运行的代码: var google = require('googleapis'); var OAuth2Client = google.auth.OAuth2; var CLIENT_ID = 'xxxx'; var CLIENT_SECRET = […]

azure色的移动服务错误找不到模块'azure-storage'

我一直在AzureMobileService自定义API中使用Azure存储 npm模块过去几个月,一直工作正常,直到几天后它开始给我这个错误 – 无法find模块“azure色存储”。 这很奇怪,因为我没有改变我的代码,实际上,它开始给我这个错误的一天,我早上检查了我的应用程序(HTML / JS应用程序),这一切都运行良好。 但是当我从工作中回来,跑了应用程序,我得到了这个错误。 下面是我的自定义API中的代码,我得到这个错误 var azure = require('azure-storage'); var retryOperationFilter = new azure.ExponentialRetryPolicyFilter(); var tableService= azure.createTableService().withFilter(retryOperationFilter); 我的package.json中包含了azure存储 – "dependencies": {"tracer": "0.7.3", "colors" : "1.0.3", "lodash" :"2.4.1", "azure-storage": "0.4.1"}, 我在“Azure-storage”npm页面上问了这个问题 ,但没有得到太多的帮助,所以现在在这里尝试; 现在已经两天了,我还没有解决,它非常烦人,我在我的智慧结束。 那里的任何人都有相同或可能有任何想法,将不胜感激,如果你能分享你可能已经得到的任何东西。

如何构build基于Express的Azure移动服务/ Moible应用程序

使用Azure和我使用networking应用程序和移动服务。 看来,移动服务是缺less一些组件,这限制了我做传统/最佳实践路由的能力。 当我克隆和检查项目时,似乎缺less存在于Azure Web App或任何家庭酿造服务器中的索引文件。 请提供您有关最佳做法的任何build议或知识,以及对我为我们的移动服务设置的任何修改。 下面的代码是我devise我们的移动服务API,因为他们似乎缺乏索引。 也许我应该制作一个专门的API来把所有东西都捆绑 任何build议或经验将有助于我们做出正确的决定。 谢谢。 var express = require('express'); var app = module.exports = express(); var bodyParser = require('body-parser'); //configure bodyparser app.use(bodyParser.urlencoded({ extended: false })) app.use(bodyParser.json()) //test app.register = function(api) { api.get('id', getNextUserId); api.get('get_user_by_email', getUser); api.post('post_user', postUser) }

在Azure移动应用程序的Azure表脚本中插入不同的表

我一直在广泛search这个答案,但只find了指代旧的Azure应用程序服务而不是新的Azure移动应用程序的解决scheme。 在这个例子中,在表格的表格脚本中,我将validation的用户ID插入到同一个表格的用户ID字段中。 table.insert(function (context) { context.item.userId = context.user.id; return context.execute(); }); 但是,如果还想将其插入到用户要求插入的另一个表中? 我怎样才能从表格脚本访问这个其他表格? 之前,正如我发现的所有解决scheme所显示的,您可以通过“tables.getTable('otherTable')”从同一个SQL DB访问另一个表。 但现在我得到一个错误。 阅读“Azure移动应用程序 – 节点SDK”文档,我发现了“context.tables()”函数,它似乎从db中获得了不同的表格。 但是当我插入使用代码下面没有任何反应: table.insert(function (context) { var table2 = context.tables('table2'); table2.insert({string_column: '1234'}); return context.execute(); }); 谢谢!

Azure移动服务表filter

我想获得在线用户arrays中的用户,但它给我下面的错误。 如果这不起作用,有人可以给我工作 码: exports.post = function(request, response) { var onlineUsers = ["6990"]; // Tables var userTable = request.service.tables.getTable('Users'); userTable.where( function(ou) { return ou.search(this.id) != -1; },onlineUsers).read({ success : function(users){ response.send(statusCodes.OK, { message : users }); } }); }; 错误: Error in script '/api/test_find.js'. Error: The expression 'ou.search(this.id)'' is not supported.

如何在azure-mobile-apps-js-client中使用substringof

我想使用azure-mobile-apps-js-client的odata substringof方法。 目前我使用indexof方法,但想切换到substringof。 我有这个代码 function queryFunction(term){ return this.FullName.indexOf(term) != -1 } table.where(queryFunction, term) 转化为 $filter=indexof(FullName, term) ne -1 我需要这样的URL: filter=substringof(term, FullName) eq true 我如何做到这一点与JavaScript?

缺lessserver.js / app.js文件,web.config不会生成

我正在使用Windows Azure Mobile Services的源代码pipe理function来推送自定义API脚本。 我做了什么: 克隆git仓库。 (它包含了一堆用readme.md文件解释什么地方的目录,以及一些现有表的权限的configuration文件。) 添加了service/api/test.js和service/api/test.json文件(自定义API脚本和configuration)。 承诺并将更改推送到远程。 我从git获得了以下输出: remote: Updating branch 'master'. remote: Updating submodules. remote: Preparing deployment for commit id '1cbfbd5ac1'. remote: Running custom deployment command… remote: Running deployment command… remote: Handling Basic Web Site deployment. remote: KuduSync.NET from: 'D:\home\site\repository\service' to: 'D:\home\site\wwwroot\App_Data\config\scripts' remote: Copying file: 'api\test.js' remote: Copying file: 'api\test.json' remote: Missing […]

如何从移动服务中“唤醒”Azure webjob?

比方说,我有一个configuration为单身的Azure webjob,并在自由站点上下文中“连续”运行。 根据Azure规范 ,在开始一段时间之后,webjob会closures,除非有人继续运行: 截至2014年3月,如果没有对scm(部署)站点的请求,且网站的门户在Azure中未打开,则处于Free模式的网站可能会在20分钟后超时。 请求到实际的网站不会重置这个。 不过,这对我来说很好。 我的目标是在调用移动服务自定义API时“唤醒”webjob实例,如下面的基本示例: exports.post = function(request, response) { //ensure the webjob running, in case wake it up var rq = require('request'); rq("http:// ??? (any site to invoke?) ", function(error, response, body) { //do nothing }); //do specific stuffs related to the mobile service var rtn = { message : 'Hello […]

Azure移动服务(节点后端)__updatedAt属性编辑后不会自动设置

阅读完文档后,我期待这个字段是由Azure移动服务自动设置的。 显然不是。 我应该configuration额外的东西吗? 我看到的其他选项(为每个表):*添加一个axtra线到节点js update(item,user,request)函数:item .__ updatedAt = new Date(); *在数据库中创build一个更新触发器 任何人都有这个经验? 谢谢!

cc的SendGrid不能在Azure移动应用程序中工作

只有下面的语法似乎在Azure移动应用程序中工作,这里解释https://azure.microsoft.com/en-us/documentation/articles/store-sendgrid-mobile-services-send-email-scripts/#comment- 2539027195 sendgrid.send({to:' email-address ',from:' from-address ',subject:'New to-do item',text:'一个新的待办事项被添加:'+ item.text},函数(成功,消息){if(!success){console.error(message);}}); 从上面可以看出,callback函数传递了成功参数,而GitHub( https://github.com/sendgrid/sendgrid-nodejs )中的node.js模块却有错误参数。 所以看起来Azure移动服务不是使用相同的模块或版本,也有一些断开连接。 sendgrid.send(email,function(err,message){if(err){console.error(message);}});