Adding custom swagger template
This commit is contained in:
7
LICENSE.md
Normal file
7
LICENSE.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Copyright 2024 Caterina Simona Pastore
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -51,8 +51,6 @@ internal class Program
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register IConfiguration in the service container
|
|
||||||
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@@ -67,11 +65,13 @@ internal class Program
|
|||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
|
app.UseStaticFiles();
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseSwaggerUI(options =>
|
app.UseSwaggerUI(options =>
|
||||||
{
|
{
|
||||||
|
options.InjectStylesheet("/swagger-ui/custom.css");
|
||||||
options.SwaggerEndpoint("/swagger/v1/swagger.json", "v1");
|
options.SwaggerEndpoint("/swagger/v1/swagger.json", "v1");
|
||||||
options.RoutePrefix = string.Empty;
|
// options.RoutePrefix = string.Empty;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
wwwroot/swagger-ui/custom.css
Normal file
20
wwwroot/swagger-ui/custom.css
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.topbar-wrapper img[alt="Swagger UI"], .topbar-wrapper span {
|
||||||
|
src
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-wrapper .link:after {
|
||||||
|
content: 'Unoffical McLaren F1 API';
|
||||||
|
/* color: #fff; */
|
||||||
|
visibility: visible;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swagger-ui .topbar .download-url-wrapper .select-label select {
|
||||||
|
border-color: #1cd6ef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swagger-ui .info .title small:last-child {
|
||||||
|
background-color: #1cd6ef !important;
|
||||||
|
}
|
||||||
BIN
wwwroot/swagger/favicon-16x16.png
Normal file
BIN
wwwroot/swagger/favicon-16x16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
wwwroot/swagger/favicon-32x32.png
Normal file
BIN
wwwroot/swagger/favicon-32x32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
wwwroot/swagger/favicon.ico
Normal file
BIN
wwwroot/swagger/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user