fix gateway本地配置
This commit is contained in:
@@ -14,4 +14,12 @@
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="ocelot.Development.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -6,9 +6,10 @@ public class Program
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureAppConfiguration(builder =>
|
||||
.ConfigureAppConfiguration((context, builder) =>
|
||||
{
|
||||
builder.AddJsonFile("ocelot.json", true, true);
|
||||
builder.AddJsonFile($"ocelot.{context.HostingEnvironment.EnvironmentName}.json", true, true);
|
||||
})
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5001"
|
||||
"applicationUrl": "http://*:6000"
|
||||
}
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json"
|
||||
|
||||
93
Src/Gateway/ocelot.Development.json
Normal file
93
Src/Gateway/ocelot.Development.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"Routes": [
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/oauth2/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/common/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5001
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/sys/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5003
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/user/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5004
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/basic/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5002
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/scheduled/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5010
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/canteen/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5008
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/{url}/swagger/v1/swagger.json",
|
||||
"DownstreamPathTemplate": "/{url}/swagger/v1/swagger.json",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 6000
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"GlobalConfiguration": {}
|
||||
}
|
||||
Reference in New Issue
Block a user