Merge pull request #5 from zerlei/develop

Develop
This commit is contained in:
Zhao Lei 2024-10-17 15:27:22 +08:00 committed by GitHub
commit 8cb7c51e3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View file

@ -37,14 +37,16 @@ if (app.Environment.IsDevelopment())
app.UseSwaggerUI(); app.UseSwaggerUI();
} }
DefaultFilesOptions defops = new DefaultFilesOptions(); DefaultFilesOptions defops = new DefaultFilesOptions();
defops.DefaultFileNames.Clear();
//defops.DefaultFileNames.Clear();
defops.DefaultFileNames.Add("index.html"); defops.DefaultFileNames.Add("index.html");
app.UseDefaultFiles(defops); app.UseDefaultFiles(defops);
app.UseStaticFiles(); app.UseStaticFiles();
app.UseWebSockets(); app.UseWebSockets();
app.UseAuthorization(); app.UseAuthorization();
app.Urls.Clear();
app.Urls.Add("http://0.0.0.0:6818"); //app.Urls.Clear();
//app.Urls.Add("http://0.0.0.0:6818");
app.MapControllers(); app.MapControllers();
app.Run(); app.Run();

View file

@ -12,6 +12,12 @@ public class SyncFilesController(RemoteSyncServerFactory factory, SqliteDbContex
private readonly SqliteDbContext _db = db; private readonly SqliteDbContext _db = db;
private readonly RemoteSyncServerFactory Factory = factory; private readonly RemoteSyncServerFactory Factory = factory;
[HttpGet("/t")]
public IActionResult ConnnectTest()
{
return Ok("网络连接正常!");
}
[Route("/websoc")] [Route("/websoc")]
public async Task WebsocketConnection(string Name) public async Task WebsocketConnection(string Name)
{ {
@ -41,6 +47,7 @@ public class SyncFilesController(RemoteSyncServerFactory factory, SqliteDbContex
HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest; HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
} }
} }
/// <summary> /// <summary>
/// 上传文件 /// 上传文件
/// </summary> /// </summary>

View file

@ -40,7 +40,8 @@ if (app.Environment.IsDevelopment())
app.UseSwaggerUI(); app.UseSwaggerUI();
} }
app.UseWebSockets(); app.UseWebSockets();
app.Urls.Clear();
app.Urls.Add("http://0.0.0.0:6819"); //app.Urls.Clear();
//app.Urls.Add("http://0.0.0.0:6819");
app.MapControllers(); app.MapControllers();
app.Run(); app.Run();