Skip to content

Commit 39d6719

Browse files
feat: adição do arquivo Program.cs
1 parent 15c6baf commit 39d6719

File tree

1 file changed

+33
-0
lines changed
  • developments/BlazorComponent/BlazorComponent

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using BlazorComponent.Components;
2+
using BlazorComponent.Repositories;
3+
4+
var builder = WebApplication.CreateBuilder(args);
5+
6+
// Add services to the container.
7+
builder.Services.AddRazorComponents()
8+
.AddInteractiveServerComponents();
9+
10+
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
11+
12+
13+
builder.Services.AddScoped<IMedicoRepository, MedicoRepository>();
14+
15+
var app = builder.Build();
16+
17+
// Configure the HTTP request pipeline.
18+
if (!app.Environment.IsDevelopment())
19+
{
20+
app.UseExceptionHandler("/Error", createScopeForErrors: true);
21+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
22+
app.UseHsts();
23+
}
24+
25+
app.UseHttpsRedirection();
26+
27+
app.UseStaticFiles();
28+
app.UseAntiforgery();
29+
30+
app.MapRazorComponents<App>()
31+
.AddInteractiveServerRenderMode();
32+
33+
app.Run();

0 commit comments

Comments
 (0)