Exemplo n.º 1
0
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
 {
     if (env.IsDevelopment())
     {
         app.UseDeveloperExceptionPage();
     }
     app.UseJimu(_host);
     _host.Run();
 }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();

            app.UseRpcSwagger();
            app.UseGateWay(_host);

            _host.Run();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            IServiceHost host = null;

            // register as server
            var builder = new ServiceHostServerBuilder(new ContainerBuilder())
                          .UseLog4netLogger()
                          .LoadServices(new string[] { "Auth.IServices", "Auth.Services" })
                          .UseDotNettyForTransfer("127.0.0.1", 8000)
                          .UseConsulForDiscovery("127.0.0.1", 8500, "JimuService", $"127.0.0.1:8000")
                          .UseJoseJwtForOAuth <DotNettyAddress>(new JwtAuthorizationOptions
            {
                SecretKey         = "123456",
                ExpireTimeSpan    = new TimeSpan(3, 0, 0, 0),
                ValidateLifetime  = true,
                ServerIp          = "127.0.0.1",
                ServerPort        = 8000,
                TokenEndpointPath = "api/oauth/token?username=&password="******"username or password is incorrect.", "");
                    }
                    else
                    {
                        ctx.AddClaim("roles", member.Role);
                        ctx.AddClaim("member", Newtonsoft.Json.JsonConvert.SerializeObject(member));
                    }
                }),
            });

            using (host = builder.Build())
            {
                //InitProxyService();
                host.Run();
                while (true)
                {
                    Console.ReadKey();
                }
            }
        }
Exemplo n.º 4
0
 private void Start()
 {
     _host.Run();
     this.Running = true;
     _waitHandle.WaitOne();
 }