Tag: azure

Node.js post方法失败,出现500错误

我是node.js的新手 我正在开发使用VS 2015的节点js应用程序。下面是我的服务器代码(app.js) 在其中一个路线(trains.js)中,我定义了一个简单的post方法,如下所示。 事情是从本地工作正常。 但是,一旦我部署到azure色的网站,POST方法抛出内部服务器错误。 有人可以帮我弄这个吗? 请让我知道,如果你需要任何进一步的细节。 //Here is my app.js var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var socketio = require('socket.io'); var global = require('./routes/globals.js'); GLOBAL._ = require('lodash'); GLOBAL.KEY = 'xxxxxxxxxxxxxxxxxxxxxx'; var availability = require('./routes/availability'); var […]

在Azure上托pipe的Express网站提供意外错误

我正在澳大利亚东南地区的Azure共享资源上运行非常简单的快速网站。 网站在端口3000上本地运行,但部署到Azure时根本不渲染。 尝试从Azure运行时抛出错误 node server.js events.js:141 throw er; // Unhandled 'error' event Error: listen EADDRINUSE 0.0.0.0:3000 at Object.exports._errnoException (util.js:874:11) at exports._exceptionWithHostPort (util.js:897:20) at Server._listen2 (net.js:1234:14) at listen (net.js:1270:10) at Server.listen (net.js:1366:5) at EventEmitter.listen (D:\home\site\wwwroot\node_modules\express\lib\application.js:617:24) at Object.<anonymous> (D:\home\site\wwwroot\server.js:21:5) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) Server.js看起来像 var express = require('express'); var app = express(); […]

使用SQL实现移动应用程序Node.js后端的表连接

由于Azure移动应用程序不提供创build表间关系的方法,因此我决定在Node.js后端创build一个自定义API以从相关表中返回数据。 这个想法是使用SQL在后端实现连接,就像移动服务文档中所解释的那样。 问题是我正在使用新的移动应用程序,而不是旧的移动服务,所以上面的代码不再工作。 据我所知,体系结构从移动服务改为移动应用程序,Node.js SDK是一个快速的中间件软件包。 所以现在我们利用azure-mobile-apps / src / data模块来处理sql操作。 所以我现在必须做这样的事情来从Node后端的Custom API中的表中读取: var queries = require('azure-mobile-apps/src/query'); module.exports = { "get": function (req, res, next) { var myTable = req.azureMobile.tables('TableName'); var query = queries.create('TableName'); query.where({'id':req.query.userId}); myTable.read(query).then(function(data){ res.send({ some: data }); }); } }; 但是由于SQL不再暴露,我不能使用JOIN命令从相关表中返回数据。 我将不得不使用循环和许多请求到数据库,这是失败的目的。 – 是否有办法在新的Mobile Apps Node.js SDK上使用SQL实现后端连接? 还是其他更好的方法? 非常感谢你!

在azure上缩放nodejs,socket.io和mongodb

我们有一个应用程序运行在一个单一的天青虚拟机上(Windows服务器R12数据中心)。 由于交通和负载的巨大,我们正在计划扩大我们的系统。 该应用程序是我们在nodeJs,socket.io和mongodb(MongoLab或MLAB)上开发的游戏。 我们的初步计划如下: 扩展操作系统:使用azure色的虚拟机规模集。 扩展数据库:鉴于我们正在使用Mlab(一个mongodb数据库即服务),我们认为缩放是由他们完成的。 对Nodejs和Socket.io的缩放效果 :我们不确定…(任何提示) 任何有这些技术经验的人都可以评论这个堆栈吗?

Node.JS WebApp部署失败,错误不明确

我的networking应用没有任何问题。 我在代码中进行了更改并提交了代码。 生成失败。 所以我回到了最后的工作提交,那里的构build成功,并再次失败。 我收到以下错误,不告诉我该怎么办。 有任何想法吗? Command: "D:\home\site\deployments\tools\deploy.cmd" Handling node.js deployment. KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot' Copying file: '.DS_Store' Copying file: 'app.js' Copying file: 'package.json' Copying file: 'bin\www' Copying file: 'js\auth.js' Copying file: 'js\chargeServer.js' Copying file: 'js\helper.js' Copying file: 'js\requiresLogin.js' Copying file: 'js\setup-passport.js' Copying file: 'node_modules\.bin\needle' Copying file: 'node_modules\auth0\.editorconfig' Copying file: 'node_modules\auth0\.jshintrc' Copying file: 'node_modules\auth0\.npmignore' […]

Azure Web App不启动节点服务器

我正在通过bitbucket发布我的typecript node.js / express azure应用程序,而且似乎所有东西都正确编译,但是azure不会启动应用程序。 一个可责备的仓库在这里 。 我尝试克隆应用程序到一个新的本地目录,然后在输出文件夹中运行deploy.cmd和调用节点启动,并且工作正常。

lwip在azure web应用程序中的node-gyp重build问题:致命错误C1083:无法打开包含文件:'nan.h':没有这样的文件或目录

我已经在Azure中部署了一个节点应用程序。 在azure色的web应用程序中的环境细节如下 – Python version : 2.7 Platform : 32 bit Dotnet framework : 4.6 Node version : 6.3.0 Npm version: 3.10.3 在我的应用程序中,我正在使用lwip,它需要使用Visual C ++构build工具进行构build。 当我做npm install在node-gyp rebuild上npm install它的失败。 我收到许多相同的消息types的错误信息 “致命错误C1083:无法打开包含文件:'nan.h':没有这样的文件或目录” 我已经检查了nan模块是否存在于node_modules中。 完整的日志附在这里: D:\home\site\wwwroot>npm install > lwip@0.0.9 install D:\home\site\wwwroot\node_modules\lwip > node-gyp rebuild D:\home\site\wwwroot\node_modules\lwip>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\npm\3.10.3\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" […]

将JavaScript的Date.now()转换为Stream Analytics中的时间戳

我试图通过在我的Azure物联网集线器中使用我的Raspberry Pi和Azurestream分析中的Node.js来收集压力值。 我使用以下代码将数据作为JSON文件发送给IoT Hub: var data = JSON.stringify({ deviceId: "myRaspi10", pressureVal: value, time:Date.now() }); 当我检查控制台,这是什么被发送到集线器 { "deviceId":"myRaspi10", "pressureVal":39, "time":1470642749428 } 如何将time值转换为Azurestream分析中的时间戳?

从自定义node.js API中检索Azure Blob

我想从Microsoft Azure blob存储容器中检索图像的二进制数据。 我已经使用AZSCloudBlobContainer上的以下function,从iOS应用程序成功地将图像上传到Azure上的存储容器。 blockBlob.uploadFromData(imageData, completionHandler: 我也可以使用AZSCloudBlob上的以下function直接将其成功下载到iOS应用程序。 blockBlob.downloadToDataWithCompletionHandler({(error: NSError?, data: NSData?) 我遇到的问题是,我希望能够从node.js服务器端脚本检索图像,而不是直接从应用程序。 其中,我已经尝试了下面的代码… var containerName = 'containerName'; var blobService = storage.createBlobService(accountName, accountKey); var blobName = 'blobname'; var fs = require('fs'); var stream = fs.createWriteStream('output.txt'); blobService.getBlobToStream(containerName, blobName, stream, function (error, result, response2) { response.json(result); }); 该响应检索blob信息,但我不知道如何获得图像的实际二进制数据? ({ blobType = BlockBlob; container = containername; contentLength = 14593; […]

整个存储帐户的Azure共享访问签名

我正在使用API​​(node.js)为使用Azure移动服务的iOS应用程序生成只读共享访问签名。 API使用以下代码生成SAS … var azure = require('azure-storage'); var blobService = azure.createBlobService(accountName, accountKey); var sas = blobService.generateSharedAccessSignature("containerName", null, sharedAccessPolicy); 当我想要SAS访问一个容器时,这很好用。 但我真的需要访问存储帐户中的所有容器。 我明显可以做到这一点与每个容器单独的API调用,但这将需要数百个额外的电话。 我到处寻找一个解决scheme,但我不能得到任何工作,我非常感激知道是否有一种方法来生成一个存储帐户中的所有容器SAS?