-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
using System.Diagnostics; | ||
using AvantiPoint.MobileAuth; | ||
using AvantiPoint.MobileAuth.Authentication; | ||
using DemoAPI.Data; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.OpenApi.Models; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
|
@@ -18,15 +19,34 @@ | |
// Add services to the container. | ||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||
builder.Services.AddEndpointsApiExplorer(); | ||
builder.Services.AddSwaggerGen(); | ||
var versionInfo = FileVersionInfo.GetVersionInfo(typeof(MobileAuth).Assembly.Location); | ||
var version = $"{versionInfo.FileMajorPart}.{versionInfo.ProductMinorPart}.{versionInfo.ProductBuildPart}"; | ||
builder.Services.AddSwaggerGen(c => | ||
{ | ||
c.SwaggerDoc($"v1", new OpenApiInfo | ||
{ | ||
Title = "Mobile Auth - Demo", | ||
Contact = new OpenApiContact | ||
{ | ||
Name = "AvantiPoint", | ||
Email = "[email protected]", | ||
Url = new Uri("https://avantipoint.com") | ||
}, | ||
Description = "This is a demo api for the AvantiPoint Mobile Auth library. Do not use this API for production. For more information please visit https://github.com/avantipoint/mobileauth-lib", | ||
Version = version | ||
}); | ||
}); | ||
|
||
var app = builder.Build(); | ||
|
||
// Configure the HTTP request pipeline. | ||
|
||
app.UseHttpsRedirection(); | ||
app.UseSwagger(); | ||
app.UseSwaggerUI(); | ||
app.UseSwaggerUI(o => | ||
{ | ||
o.InjectStylesheet("https://cdn.avantipoint.com/theme/swagger/style.css"); | ||
}); | ||
|
||
app.UseAuthentication(); | ||
app.UseAuthorization(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters