Rename old C# backend folder
This commit is contained in:
parent
f3eb84d812
commit
dc685661a7
16 changed files with 0 additions and 0 deletions
41
backend-C#/LeakyShipsAPI/Program.cs
Normal file
41
backend-C#/LeakyShipsAPI/Program.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using LeakyShipsAPI.Hubs;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSignalR();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddCors();
|
||||
|
||||
var app = builder.Build();
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
app.UseCors(policyBuilder => policyBuilder
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyOrigin()
|
||||
.AllowCredentials()
|
||||
);
|
||||
}
|
||||
app.UseHttpsRedirection();
|
||||
app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHub<GameHub>("/hub");
|
||||
});
|
||||
|
||||
app.MapGet("/", () => "Hello World!");
|
||||
|
||||
//Websocket functions
|
||||
|
||||
//SessionStart name -> sessionId
|
||||
//SessionJoin sessionCode, name -> sessionId
|
||||
//StartGame sessionId, settings
|
||||
//SubmitBoard shipPositions[] ->
|
||||
//
|
||||
|
||||
app.Run();
|
Loading…
Add table
Add a link
Reference in a new issue