public void SetUp()
        {
            _urlHelper = Substitute.For <UrlHelper>();
            var locatorConfig = new RoutesConfig();

            _locator = new ItemUrlLocator(_urlHelper, locatorConfig);
        }
예제 #2
0
        public void Configuration(IAppBuilder app, bool selfHost)
        {
            ConfigureProject(selfHost, TerminalStatXBootstrapper.ConfigureLive);
            SwaggerConfig.Register(_configuration);
            RoutesConfig.Register(_configuration);
            ConfigureFormatters();
            app.UseWebApi(_configuration);

            if (!selfHost)
            {
                StartHosting();
            }
        }
예제 #3
0
        static void Main()
        {
            //create database SharpStoreDB and seed data
            SharpStoreContext context = Data.Context;

            context.Database.Initialize(true);
            SeedUsers(context);
            SeedKnifes(context);

            //config and run server
            var        routes     = RoutesConfig.UseRoutes();
            HttpServer httpServer = new HttpServer(8081, routes);

            httpServer.Listen();
        }
예제 #4
0
        void Application_Start(object sender, EventArgs e)
        {
            InitProfilerSettings();

            string configDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config");

            // load the configuration file for log4net
            string logFilePath = Path.Combine(configDir, "log.config");

            log4net.Config.XmlConfigurator.Configure(new FileInfo(logFilePath));

            // initialize structure map
            string structureMapPath = Path.Combine(configDir, "StructureMap.config");

            StructureMapHelper.Initialize(structureMapPath);

            //load the configuration for Route
            RoutesConfig.Configure("RouteRule");

            // this is only done for testing purposes so we don't check in the db to source control
            // ((SampleWeb.Helpers.SqliteMiniProfilerStorage)MiniProfiler.Settings.Storage).RecreateDatabase();
        }
예제 #5
0
 public static void Register(HttpConfiguration config)
 {
     DependencyInjectionConfig.Config(config);
     FormattersConfig.Config(config);
     RoutesConfig.Config(config);
 }