2015-11-20 49 views
7

创建使用Azure的SDK 2.7和Node.js的工具在Visual Studio 2015年的Node.js应用天青:“您没有权限查看该目录或页面

我已成功设置。 CI与BitBucket在我的web应用程序,我可以看到,更改存储库确实会触发构建和部署。

但是,我达到的页面(http://ftct.azurewebsites.net/)抱怨:您没有权限查看此目录或

我在我的no中指定了一个默认文件(kinda) de.js通过使用:app.get('/',routes.index);

因此试图直接导航到此文件http://ftct.azurewebsites.net/signin.html会产生不同的错误:您正在查找的资源已被删除,名称已更改或暂时不可用。

我将应用程序配置为在Visual Studio中的端口1337上运行,但使用此端口不能解决问题。尝试导航到移植的地址会产生超时。

任何想法?

回答

4

编辑:尝试从图库https://portal.azure.com创建“Node JS空Web应用程序”,并将web.config和网站与您拥有的内容进行比较。有可能您错过了一些配置设置。

enter image description here

以前的答案:第一关,只有端口80和443都在Azure的Web应用程序(天青网站的新名称)。所以港口1337将无法正常工作。将您的应用重新配置为在端口80或443上运行。关于权限问题,您是否启用了应用服务验证?通过编辑Web应用程序的设置,确保它被禁用,如下所示。

enter image description here

+0

我现在在端口80上运行,身份验证已禁用... grr ... – serlingpa

+0

将您的应用与图库应用进行比较,正如我在上面的编辑中所述。 – theadriangreen

+0

我可以在Azure中找到node.js初学者应用程序!我在“新建”部分搜索了“节点”。 – serlingpa

3

你可以试着从旧的门户http://manage.windowsazure.com图库打造“节点JS空Web应用程序”的实例,见下文。

enter image description here

enter image description here

然后,在Web应用程序信息中心页quick glanceset up deployment from source control部署Web应用程序。

enter image description here

enter image description here

现在,浏览网页应用http://<app-name>.azurewebsites.net工作正常。

3

我有同样的问题,

你需要web.config中的package.json,服务器。在根JS

的web.config:

<configuration> 
    <system.webServer> 
     <handlers> 
      <!-- indicates that the app.js file is a node.js application to be handled by the iisnode module --> 
      <add name="iisnode" path="server.js" verb="*" modules="iisnode" /> 
     </handlers> 
     </system.webServer> 
</configuration> 

中的package.json,你需要有:

... 
    "scripts": { 
    "start": "node server" 
    }, 
... 

,并在您server.js确保您设置的服务器端口号到

process.env.PORT || 1337;

相关问题