コード例 #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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: samistep/PI-1112SV
        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();
        }
コード例 #3
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();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: samistep/PI-1112SV
        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();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: driverpt/PI-1112SV
        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();
        }