内のフォルダから静的ファイルをサーブ:wwwroot
インサイドは、私はASP.NETコアプロジェクト構造次いるwwwrootの
.
├── Controllers
├── Dockerfile
├── Models
├── Program.cs
├── Properties
├── README.md
├── Services
├── Startup.cs
├── Views
├── appsettings.json
├── bundleconfig.json
├── project.json
├── web.config
└── wwwroot
は、私はアウレリアcli
使っオーレリアプロジェクトを設定しています。ここではどのような私のStartup.cs
configureがあります
.
├── aurelia-app
├── css
├── images
├── js
└── temp.html
と私aurelia-app
は、私は(私はlocalhost:5000
を参照するとき、それはwwwroot
にあった場合、同様の方法で、)提供したいindex.html
ファイルを持っている
:それは、以下の構造を有しています
私はベースURLのロード時になるように変更する必要があり、それがでindex.html
ファイルを探します何
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseBrowserLink();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseFileServer(new FileServerOptions
{
EnableDefaultFiles = true,
EnableDirectoryBrowsing = true,
});
app.UseMvc();
}
:()メソッドは次のようになりますディレクトリ?
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files – Alexan
はい、私は 'PhysicalFileProvider'ソリューションを使用して試してみましたが、私はエラーを取得します'PhysicalFileProvider not found'、どうすれば追加できますか? – akshayKhot
私はVSCodeを使用していますので、 'nuget'なしで外部依存関係を追加する方法は不明です。 – akshayKhot