main
|
Last change
on this file since 08aefc6 was 08aefc6, checked in by mmilevski <markomilevski3@…>, 4 weeks ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
711 bytes
|
| Rev | Line | |
|---|
| [08aefc6] | 1 | using Microsoft.EntityFrameworkCore;
|
|---|
| 2 | using KernelRecordsMVC.Data;
|
|---|
| 3 |
|
|---|
| 4 | var builder = WebApplication.CreateBuilder(args);
|
|---|
| 5 |
|
|---|
| 6 | builder.Services.AddControllersWithViews();
|
|---|
| 7 |
|
|---|
| 8 | builder.Services.AddDbContext<KernelRecordsContext>(options =>
|
|---|
| 9 | options.UseNpgsql(
|
|---|
| 10 | builder.Configuration.GetConnectionString("KernelRecords")));
|
|---|
| 11 |
|
|---|
| 12 | builder.Services.AddSession();
|
|---|
| 13 |
|
|---|
| 14 | var app = builder.Build();
|
|---|
| 15 |
|
|---|
| 16 | if (!app.Environment.IsDevelopment())
|
|---|
| 17 | {
|
|---|
| 18 | app.UseExceptionHandler("/Home/Error");
|
|---|
| 19 | app.UseHsts();
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | app.UseHttpsRedirection();
|
|---|
| 23 | app.UseStaticFiles();
|
|---|
| 24 |
|
|---|
| 25 | app.UseRouting();
|
|---|
| 26 |
|
|---|
| 27 | app.UseSession();
|
|---|
| 28 |
|
|---|
| 29 | app.UseAuthorization();
|
|---|
| 30 |
|
|---|
| 31 | app.MapControllerRoute(
|
|---|
| 32 | name: "default",
|
|---|
| 33 | pattern: "{controller=Home}/{action=Index}/{id?}");
|
|---|
| 34 |
|
|---|
| 35 | app.Run(); |
|---|
Note:
See
TracBrowser
for help on using the repository browser.