diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-12-12 15:27:40 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-12-12 15:27:40 +0200 |
| commit | 9263e0c66aa7463975635a36ddcc85b45af0c66c (patch) | |
| tree | 2af4ee64e71867c13a1beef6ad5dad838d86ca99 /API/Startup.cs | |
| parent | e7912e18285f0381e66e78da948c0cd37a06fbd7 (diff) | |
| download | DevHive-9263e0c66aa7463975635a36ddcc85b45af0c66c.tar DevHive-9263e0c66aa7463975635a36ddcc85b45af0c66c.tar.gz DevHive-9263e0c66aa7463975635a36ddcc85b45af0c66c.zip | |
Fixed merge conflicts
Diffstat (limited to 'API/Startup.cs')
| -rw-r--r-- | API/Startup.cs | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/API/Startup.cs b/API/Startup.cs index 49dd794..de108a5 100644 --- a/API/Startup.cs +++ b/API/Startup.cs @@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
-<<<<<<< HEAD
using Microsoft.OpenApi.Models;
using Data.Models.Classes;
using Data.Models.Options;
@@ -13,9 +12,10 @@ using Microsoft.IdentityModel.Tokens; using Microsoft.AspNetCore.Authentication.JwtBearer;
using System.Text;
using System.Threading.Tasks;
-=======
using API.Extensions;
->>>>>>> 8bd7295dc4694c1c0ed6fbc05d390223bfc4ef05
+using API.Database;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.AspNetCore.Identity;
namespace API
{
@@ -33,19 +33,6 @@ namespace API {
services.AddControllers();
- services.AddDbContext<DevHiveContext>(options =>
- options.UseNpgsql(Configuration.GetConnectionString("DEV")));
-
- services.AddIdentity<User, UserRoles>()
- .AddEntityFrameworkStores<DevHiveContext>();
-
- services.Configure<IdentityOptions>(options =>
- {
- options.User.RequireUniqueEmail = true;
-
- options.Password.RequiredLength = 5;
- });
-
services.AddSingleton<JWTOptions>(
new JWTOptions(Configuration.GetSection("AppSettings").GetSection("Secret").Value));
@@ -78,11 +65,6 @@ namespace API };
});
- services.AddSwaggerGen(c =>
- {
- c.SwaggerDoc("v1", new OpenApiInfo { Title = "API", Version = "v1" });
- });
-
services.DatabaseConfiguration(Configuration);
services.SwaggerConfiguration();
services.JWTConfiguration();
@@ -105,8 +87,9 @@ namespace API app.UseHsts();
}
+ app.UseDatabaseConfiguration();
app.UseJWTConfiguration();
-
+
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
|
