diff --git a/Server/LocalServer/Program.cs b/Server/LocalServer/Program.cs index e0b2d86..6a7fa93 100644 --- a/Server/LocalServer/Program.cs +++ b/Server/LocalServer/Program.cs @@ -37,14 +37,16 @@ if (app.Environment.IsDevelopment()) app.UseSwaggerUI(); } DefaultFilesOptions defops = new DefaultFilesOptions(); -defops.DefaultFileNames.Clear(); + +//defops.DefaultFileNames.Clear(); defops.DefaultFileNames.Add("index.html"); app.UseDefaultFiles(defops); app.UseStaticFiles(); app.UseWebSockets(); 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.Run(); diff --git a/Server/RemoteServer/Controllers/RemoteServerController.cs b/Server/RemoteServer/Controllers/RemoteServerController.cs index 33f79c5..d59bcd6 100644 --- a/Server/RemoteServer/Controllers/RemoteServerController.cs +++ b/Server/RemoteServer/Controllers/RemoteServerController.cs @@ -12,6 +12,12 @@ public class SyncFilesController(RemoteSyncServerFactory factory, SqliteDbContex private readonly SqliteDbContext _db = db; private readonly RemoteSyncServerFactory Factory = factory; + [HttpGet("/t")] + public IActionResult ConnnectTest() + { + return Ok("网络连接正常!"); + } + [Route("/websoc")] public async Task WebsocketConnection(string Name) { @@ -41,6 +47,7 @@ public class SyncFilesController(RemoteSyncServerFactory factory, SqliteDbContex HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest; } } + /// /// 上传文件 /// diff --git a/Server/RemoteServer/Program.cs b/Server/RemoteServer/Program.cs index 6c11bb7..35d4da4 100644 --- a/Server/RemoteServer/Program.cs +++ b/Server/RemoteServer/Program.cs @@ -40,7 +40,8 @@ if (app.Environment.IsDevelopment()) app.UseSwaggerUI(); } 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.Run();