示例#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
        static void Main(string[] args)
        {
            var host = new HttpHost("http://localhost:8080");

            host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(typeof(ToDoController)));
            host.Open();
            Console.WriteLine("Server is running, press any key to continue...");
            Console.ReadKey();
            host.Close();
        }
示例#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();
        }
示例#4
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();
        }
 public IntegrationTests()
 {
     _host = new HttpHost("http://localhost:8080");
     _host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(typeof(Controller)));
     _host.Open();
 }