|
12345678910111213141516171819202122232425262728293031323334353637383940 |
- using BPASmartClient.AgvApi;
- using Microsoft.AspNetCore.Cors.Infrastructure;
-
-
-
- var builder = WebApplication.CreateBuilder(args);
-
- // Add services to the container.
-
- builder.Services.AddControllers();
- // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
- builder.Services.AddEndpointsApiExplorer();
- builder.Services.AddSwaggerGen();
- builder.Services.AddSignalR();//עSignalR
- var app = builder.Build();
-
- // Configure the HTTP request pipeline.
- if (app.Environment.IsDevelopment())
- {
- app.UseSwagger();
- app.UseSwaggerUI();
- }
-
- app.Use(async (context, next) =>
- {
- context.Request.Headers["appKey"] = "0123456789abcdef";
- context.Response.Headers["appSecret"] = "0123456789abcdef";
- context.Response.Headers["requestId"] = "5f643ece-dc53-4d55-8e5f-d1e2dfd6a6d0";
- context.Response.Headers["timestamp"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- context.Response.Headers["version"] = "2.8";
- await next();
- });
-
-
- app.UseAuthorization();
-
- app.MapControllers();
- app.MapHub<PersonHub>("/personhub");
-
- app.Run();
|