commit
8cb7c51e3e
3 changed files with 15 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue