Huge work
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using KTUSAPS.Services;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using VueCliMiddleware;
|
||||
|
||||
namespace KTUSAPS
|
||||
@@ -39,7 +42,12 @@ namespace KTUSAPS
|
||||
.RequireAuthenticatedUser()
|
||||
.Build();
|
||||
});
|
||||
|
||||
|
||||
var connectionString = Configuration.GetConnectionString("Main");
|
||||
services.AddDbContext<Data.SAPSDataContext>((options) => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
|
||||
services.AddHostedService<DatabaseInitializationService>();
|
||||
|
||||
services.AddSwaggerGen();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
@@ -48,8 +56,16 @@ namespace KTUSAPS
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "API");
|
||||
});
|
||||
}
|
||||
|
||||
app.UseSwagger(c =>
|
||||
{
|
||||
});
|
||||
app.UseRouting();
|
||||
app.UseSpaStaticFiles();
|
||||
app.UseAuthentication();
|
||||
|
Reference in New Issue
Block a user