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)
{
();
}
}
}
}
}