Location>code7788 >text

dotnet core microservices framework Jimu ~ Member Registration Microservice

Popularity:617 ℃/2024-11-07 18:16:57
using ; using System; namespace { class Program { static void Main(string[] args) { var builder = new ServiceHostServerBuilder(new ()) .UseLog4netLogger() // Logging with log4net .LoadServices("", "") // loading service .UseDotNettyForTransfer("127.0.0.1", 8001) // DotNetty listens on port 8001 for communication. .UseConsulForDiscovery("127.0.0.1", 8500, "JimuService", $"127.0.0.1:8001") // Use consul, "JimiService" to specify a prefix to the key when registering a service, which is equivalent to a service grouping, and $"127.0.0.1:8001" to specify the service host's access address. .UseJoseJwtForOAuth<>(new { SecretKey = "123456", }); // Use jwt for authentication, here just authenticate the token, so only need to authenticate the key, produce the token in the service using (var host = ()) { (); // Starting services while (true) { (); } } } } }