aboutsummaryrefslogtreecommitdiffstats
path: root/src/Program.cs
blob: 0f54b876aad9c8b78e5945645ae2d2c1d36dff9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
global using I2R.LightNews.Services;
global using I2R.LightNews.Models;
global using IOL.Helpers;
using I2R.LightNews;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddHttpClient<NrkRadioService>();
builder.Services.AddHttpClient<NrkNewsService>();
builder.Services.AddMemoryCache();
builder.Services.AddScoped<NrkNewsService>();
builder.Services.AddScoped<NrkRadioService>();
builder.Services.AddControllers();
builder.Services.AddRazorPages().AddRazorRuntimeCompilation();

var app = builder.Build();

app.UseStaticFiles();
app.UseStatusCodePages();
app.UseRouting();
app.MapRazorPages();
app.MapControllers();
Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true;
RadioIndexDb.CreateIfNotExists();
app.Run();