Microservices Demo | Building Microservices with .NET Core C# | Ocelot API Gateway | Sukhraj

preview_player
Показать описание
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": {
}
}
Рекомендации по теме
Комментарии
Автор

Thanks for the very much informative video😀

shivajikakad
Автор

Thanks for sharing, Your video is more helpful to me. Could you please make one more video handling large project with ocelot and different-2 environment like dev, UAT and QA how manage?.

eshanmishra
Автор

Great video! Do you happen to have information on deploying to IIS? I'm currently running some tests, and I can't seem to get it to work

personalaristobulo
Автор

Hey hey please please tell me how did you add microservices to this solutions

harshkadam
Автор

The httpDelete method cannot be accessed through a URL, Accessing through URL makes it the HttpGet method, otherwise it is informative

backendb.
Автор

What if I need to pass json body to post request?

siddharth
Автор

Awesome brother.. can i get source for this to understand better

salmangetify
Автор

You have used httpdelete not httpget for productversion endpoint 😅

thejass