forked from hosseinJavadi/vizhvizhBack
first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Ocelot.DependencyInjection;
|
||||
using Ocelot.Middleware;
|
||||
using Ocelot.Values;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddOcelot();
|
||||
builder.Services.AddSwaggerForOcelot(builder.Configuration);
|
||||
builder.Configuration.SetBasePath(builder.Environment.ContentRootPath);
|
||||
builder.Configuration.AddJsonFile("ocelot.json");
|
||||
builder.WebHost.UseIIS()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration();
|
||||
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.AddMvc();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseSwaggerForOcelotUI(opt =>
|
||||
{
|
||||
opt.PathToSwaggerGenerator = "/swagger/docs";
|
||||
});
|
||||
app.UseOcelot().Wait();
|
||||
|
||||
app.Run();
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:17619",
|
||||
"sslPort": 44373
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger/index.html",
|
||||
"applicationUrl": "http://localhost:5192",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger/index.html",
|
||||
"applicationUrl": "https://localhost:7135;http://localhost:5192",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
||||
<PackageReference Include="MMLib.SwaggerForOcelot" Version="8.3.2" />
|
||||
<PackageReference Include="Ocelot" Version="23.4.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="8.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="8.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"SwaggerEndPoints": [
|
||||
{
|
||||
"Key": "shop",
|
||||
"Config": [
|
||||
{
|
||||
"Name": "Shop API",
|
||||
"Version": "v1",
|
||||
"Url": "https://localhost:44331/swagger/v1/swagger.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"Routes": [
|
||||
{
|
||||
"DownstreamPathTemplate": "/api/Values/AddShop",
|
||||
"DownstreamScheme": "https",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 44331
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/shop/AddShop",
|
||||
"UpstreamHttpMethod": [ "Post" ],
|
||||
"SwaggerKey": "shop"
|
||||
},
|
||||
{
|
||||
"DownstreamPathTemplate": "/api/Values/GetById",
|
||||
"DownstreamScheme": "https",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 44331
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/shop/GetById",
|
||||
"UpstreamHttpMethod": [ "Get" ],
|
||||
"SwaggerKey": "shop"
|
||||
}
|
||||
],
|
||||
|
||||
"GlobalConfiguration": {
|
||||
"BaseUrl": "https://localhost:7135"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user