Example #1
0
        static void Main( string[] args )
        {
            Trace.Listeners.Add( new ConsoleTraceListener() );

            InitPermissions();
            InitUsers();
            InitShows();

            var host = new HttpListenerBasedHost( "http://localhost:8080/" );
            host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(
                                                                    typeof( UserController     )
                                                                  , typeof( HomeController     )
                                                                  , typeof( ShowController     )
                                                                  , typeof( ProposalController )
                                                                  , typeof( AuthController     )
                                                                  , typeof( ApiController      )
                                                                  )
            );

            host.Pipeline.AddFilterFirst( "ConsoleLog"    , typeof( RequestConsoleLogFilter )                   );
            host.Pipeline.AddFilterAfter( "Authentication", typeof( AuthenticationFilter    ), "ConsoleLog"     );
            host.Pipeline.AddFilterAfter( "Authorization" , typeof( AuthorizationFilter     ), "Authentication" );
            //host.Add( new DummyCommand() );
            host.OpenAndWaitForever();
        }
Example #2
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());

            InitPermissions();
            InitUsers();
            InitShows();

            var host = new HttpListenerBasedHost("http://localhost:8080/");

            host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(
                         typeof(UserController)
                         , typeof(HomeController)
                         , typeof(ShowController)
                         , typeof(ProposalController)
                         , typeof(AuthController)
                         , typeof(ApiController)
                         )
                     );

            host.Pipeline.AddFilterFirst("ConsoleLog", typeof(RequestConsoleLogFilter));
            host.Pipeline.AddFilterAfter("Authentication", typeof(AuthenticationFilter), "ConsoleLog");
            host.Pipeline.AddFilterAfter("Authorization", typeof(AuthorizationFilter), "Authentication");
            //host.Add( new DummyCommand() );
            host.OpenAndWaitForever();
        }
Example #3
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            var host = new HttpListenerBasedHost("http://localhost:8080/");

            host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(typeof(Controller)));
            host.Pipeline.AddFilterFirst("ConsoleLog", typeof(RequestConsoleLogFilter));
            host.Pipeline.AddFilterAfter("Authentication", typeof(AuthenticationFilter), "ConsoleLog");
            host.Add(new DummyCommand());
            host.OpenAndWaitForever();
        }
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            var repo = ToDoRepositoryLocator.Get();
            repo.Add(new ToDo {Description = "Learn HTTP better"});
            repo.Add(new ToDo { Description = "Learn HTML 5 better"});

            var host = new HttpListenerBasedHost("http://localhost:8080/");
            host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(
                typeof(ToDosController),
                typeof(ToDoController)));
            host.OpenAndWaitForever();
        }
Example #5
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            var repo = ToDoRepositoryLocator.Get();

            repo.Add(new ToDo {
                Description = "Learn HTTP better"
            });
            repo.Add(new ToDo {
                Description = "Learn HTML 5 better"
            });

            var host = new HttpListenerBasedHost("http://localhost:8080/");

            host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(
                         typeof(ToDosController),
                         typeof(ToDoController)));
            host.OpenAndWaitForever();
        }