angular - 角度访问 IIS 中的虚拟目录,端口为 4200
问题描述
我已经配置了一个包含一些照片的 IIS 虚拟目录,但是我可以从 Angular 应用程序访问 trublle。我有一个 404 NOT FOUND 错误。同时,我可以通过 80 端口的链接访问该文件夹。
我试图在 IIS 上绑定时添加端口 4200,但在这种情况下应用程序将无法工作
我已经添加了这个代码启动但即使删除它也没有影响:
public override void AddApplicationSpecificConfigure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseFileServer(new FileServerOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "UploadedImages")),
RequestPath = "/StaticFiles",
EnableDirectoryBrowsing = true
});
HTML 调用:
<ng-container matColumnDef="url">
<th mat-header-cell *matHeaderCellDef> Image Url </th>
<td mat-cell *matCellDef="let element"> <img [src]="element.url" /> </td>
</ng-container>
解决方案
推荐阅读
- linux - 仅保存使用 curl 下载的最后 x MB 音频流
- excel - 通过 VBA Excel 导入 Teradata TXT 文件
- passport.js - 是否有关于如何在 Nest.Js 中实现“Passport Azure AD”的文档?
- sql - 从 SQL JOIN 查询获取所需输出的问题
- iis - 如何在 IIS 中发布 aurelia 项目
- react-native - 反应本机自定义互联网电话
- android - Android Firebase 用户更新之间的持久性
- ocaml - 致命错误:异常 Graphics.Graphic_failure("Cannot open display")
- visual-studio-code - VSCode 自定义窗口边框
- java - 帮助小学生学习乘法的写作程序