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