Azure Web App收到“您没有查看此目录或页面的权限".启动应用程序时 [英] Azure Web App getting "You do not have permission to view this directory or page." when launch app

查看:30
本文介绍了Azure Web App收到“您没有查看此目录或页面的权限".启动应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有Express的点头js.我已经在我的本地计算机上对其进行了测试,并且该页面非常容易拉出.用

启动服务器

 节点index.js 

据我了解,我不需要显式定义web.config,所以我不需要.我

这是我的文件

index.js

  const http = require('http');const fs = require('fs');const express = require('express');const app = express();app.get('/',(req,res)=> {res.send('Hello World')})app.get('/api/courses',(req,res)=> {res.send([1,2,3])})app.listen(3000,()=> console.log('listening')) 

package.json

  {名称":"geoscavenge",版本":"1.0.0&"," description":","main":"index.js",脚本":{"test":"echo \"错误:未指定测试\"&&1号出口"},存储库":{"type":"git","URL":"https://geoscavenge.scm.azurewebsites.net:443/geoscavenge.git"},关键字":[],作者":",许可证":"ISC",依赖项":{表达":"^ 4.17.1";}} 

解决方案

此问题通常是由于缺少 web.config 引起的.

解决方案:

  1. 在Linux环境中部署Web应用.

  2. 仍然使用Windows环境,手动添加web.config文件,您可以参考

    I'm using nods js with express. I've tested it on my local machine and the page pulls up easy enough. start server with

    node index.js
    

    from my understanding I don't need to explicitly define the web.config so I haven't. I

    here are my files

    index.js

    const http = require('http');
    const fs = require('fs');
    const express = require('express');
    const app = express();
    
    app.get('/', (req, res) => {
       res.send('Hello World')
    })
    
    app.get('/api/courses', (req, res) => {
      res.send([1,2,3])
    })
    
    app.listen(3000, () => console.log('listening'))
    

    package.json

    {
      "name": "geoscavenge",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "https://geoscavenge.scm.azurewebsites.net:443/geoscavenge.git"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "dependencies": {
        "express": "^4.17.1"
      }
    }
    

    解决方案

    This problem is generally caused by the lack of web.config.

    Solution:

    1. Deploy the webapp in the Linux environment.

    2. Still use the windows environment, manually add the web.config file, you can refer to https://github.com/Azure-Samples/nodejs-docs-hello-world/blob/master/web.config

    3. The easiest way is to use git for deployment. In git deployment, git will automatically create a web.config file.

    这篇关于Azure Web App收到“您没有查看此目录或页面的权限".启动应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆