filmov
tv
Microservices Demo | Building Microservices with .NET Core C# | Ocelot API Gateway | Sukhraj
Показать описание
Microservices is a new software architecture. It is based on the Web Services (Web APIs). Microservices are the architectural approach to build applications from small to large scale applications.
An API gateway is an API management tool that sits between a client and a collection of backend services.
Ocelot is a lightweight, open-source, scalable, and fast API Gateway based on . NET Core and specially designed for microservices architecture. Basically, it is a set of middleware designed to work with ASP.NET Core.
It has several features such as routing, caching, security, rate limiting, etc.
Configuration File Syntax
{
"Routes": [
{
"UpstreamPathTemplate": "/gateway/product",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"DownstreamPathTemplate": "/api/product",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44339
}
],
"DangerousAcceptAnyServerCertificateValidator": true
},
{
"UpstreamPathTemplate": "/gateway/product/{id}",
"UpstreamHttpMethod": [ "GET", "DELETE" ],
"DownstreamPathTemplate": "/api/product/ProductVersion/{id}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44339
}
],
"DangerousAcceptAnyServerCertificateValidator": true
},
{
"UpstreamPathTemplate": "/gateway/customer",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"DownstreamPathTemplate": "/api/customer",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44398
}
],
"DangerousAcceptAnyServerCertificateValidator": true
},
{
"DownstreamPathTemplate": "/api/customer/{id}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44398
}
],
"UpstreamPathTemplate": "/gateway/customer/{id}",
"UpstreamHttpMethod": [ "GET", "DELETE" ],
"DangerousAcceptAnyServerCertificateValidator": true
}
],
"GlobalConfiguration": {
}
}
An API gateway is an API management tool that sits between a client and a collection of backend services.
Ocelot is a lightweight, open-source, scalable, and fast API Gateway based on . NET Core and specially designed for microservices architecture. Basically, it is a set of middleware designed to work with ASP.NET Core.
It has several features such as routing, caching, security, rate limiting, etc.
Configuration File Syntax
{
"Routes": [
{
"UpstreamPathTemplate": "/gateway/product",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"DownstreamPathTemplate": "/api/product",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44339
}
],
"DangerousAcceptAnyServerCertificateValidator": true
},
{
"UpstreamPathTemplate": "/gateway/product/{id}",
"UpstreamHttpMethod": [ "GET", "DELETE" ],
"DownstreamPathTemplate": "/api/product/ProductVersion/{id}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44339
}
],
"DangerousAcceptAnyServerCertificateValidator": true
},
{
"UpstreamPathTemplate": "/gateway/customer",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"DownstreamPathTemplate": "/api/customer",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44398
}
],
"DangerousAcceptAnyServerCertificateValidator": true
},
{
"DownstreamPathTemplate": "/api/customer/{id}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 44398
}
],
"UpstreamPathTemplate": "/gateway/customer/{id}",
"UpstreamHttpMethod": [ "GET", "DELETE" ],
"DangerousAcceptAnyServerCertificateValidator": true
}
],
"GlobalConfiguration": {
}
}
Комментарии