Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- 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();
|