相关疑难解决方法(0)

无法获取index.html Azure Linux Web App

我们在Microsoft Azure中创建了一个Linux Web App。该应用程序是用React(HTML和Javascript)静态编写的。我们将代码复制到了wwwroot文件夹中,但是该应用程序仅仅显示hostingstart.html,并且当我们尝试获取页面index.html时出现以下错误: Cannot GET /index.html

我们尝试在GitHub(https://github.com/Azure-Samples/html-docs-hello-world)中使用Azure的示例,但错误是相同的。网址是这样的:https//consoleadmin.azurewebsites.net/index.html

上周,应用程序运行正常。

我们忘了做什么?

azure reactjs azure-web-app-service

5
推荐指数
2
解决办法
1670
查看次数

在Azure Web App上运行Node.js.

我试图在Azure Web Appp上运行一个非常简单的node.js服务器来提供单页面应用程序.服务器将提供静态页面,并且总是服务器'index.html'用于页面请求,因为所有路由都在客户端完成.

所有工作都完全在本地完成,但在部署到Azure时,任何页面请求都会导致"您要查找的资源已被删除...",这表明节点服务器未被命中.

我使用Koa作为服务器,server.js在这里;

var Koa = require('koa');
var convert = require('koa-convert');
var helmet = require('koa-helmet');
var historyApiFallback = require('koa-connect-history-api-fallback');
var serve = require('koa-static');
var app = new Koa();

// This rewrites all routes requests to the root /index.html file
// (ignoring file requests). If you want to implement isomorphic
// rendering, you'll want to remove this middleware.
app.use(convert(historyApiFallback({
  verbose: false
})));

// Serving ~/dist by default. Ideally these files should be served by
// the web server and …
Run Code Online (Sandbox Code Playgroud)

azure node.js azure-web-sites koa

0
推荐指数
1
解决办法
7233
查看次数