public void SetUp() { _urlHelper = Substitute.For <UrlHelper>(); var locatorConfig = new RoutesConfig(); _locator = new ItemUrlLocator(_urlHelper, locatorConfig); }
public void Configuration(IAppBuilder app, bool selfHost) { ConfigureProject(selfHost, TerminalStatXBootstrapper.ConfigureLive); SwaggerConfig.Register(_configuration); RoutesConfig.Register(_configuration); ConfigureFormatters(); app.UseWebApi(_configuration); if (!selfHost) { StartHosting(); } }
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(); }
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(); }
public static void Register(HttpConfiguration config) { DependencyInjectionConfig.Config(config); FormattersConfig.Config(config); RoutesConfig.Config(config); }