45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
|
|
|
|
|
|
//ZXING.dll does not copy properly to publish folder, copy manually from another lib, ie cvrlib-nf.
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddRazorPages();
|
|
|
|
builder.Services.AddControllers().AddJsonOptions((options => {
|
|
//was changing PRINTER_NAME to printeR_NAME (pascal Case: https://github.com/dotnet/runtime/issues/30887)
|
|
options.JsonSerializerOptions.PropertyNamingPolicy = null;
|
|
}));
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment()) {
|
|
app.UseExceptionHandler("/Error");
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
app.UseHsts();
|
|
|
|
}
|
|
|
|
VSERVERWS.Global.Globals.IsDevelopment = app.Environment.IsDevelopment();
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
|
|
app.MapControllers();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapRazorPages();
|
|
|
|
app.Run();
|
|
|
|
|
|
VSERVERWS.Global.Globals.LoadPrinters(); |