我有一个 Angular 应用程序部署在本地(Window Serve)上,并且运行良好。但是,一旦我使用应用程序服务在 Azure 上部署该应用程序,图像就不会显示。
在 Azure 上,内容/类型显示为 text/html。
需要显示图像。
以下是我使用 Azure DevOps 将 Angular 应用程序部署到 Azure Static Web Apps 所采取的步骤,供您参考。
home.png
文件添加到 index.html
文件中。<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<p>This is a png:</p>
<img src="assets/home.png" alt="Home Image">
</head>
<body>
<app-root></app-root>
</body>
</html>
按照此处的步骤创建静态 Web 应用程序。将自动创建 DevOps 管道来部署应用程序。