Example #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)
        {
            app.UseLiteWebSocket(new LiteWebSocketOptions()
            {
                BasePath = new PathString("/test/lws")
            });

            MessageControllerResolver resolver = app.ApplicationServices.GetService <MessageControllerResolver>();

            resolver.AddSupportedMessage <TestMessageScope.Test1>();
            resolver.AddSupportedMessage <TestMessageScope.Test2>();
            resolver.AddSupportedMessage <TestMessageScope.Test3>();
            resolver.RegisterController <TestController>();

            LiteWebSocketDefaults.Filters.Add(new GlobalFilter());

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });
        }