public override void Configure(Container container) { this.Config = new AppConfig { RootDirectory = "App_Data/files/", TextFileExtensions = "txt,sln,proj,cs,config,asax".Split(',').ToList(), ExcludeDirectories = new List<string>(), }; container.Register(this.Config); }
public override void Configure(Container container) { this.Config = new AppConfig { RootDirectory = "~/App_Data/files/".MapAbsolutePath(), TextFileExtensions = ".txt,.sln,.proj,.cs,.config,.asax".Split(','), }; container.Register(this.Config); this.Start(ListeningOn); }
/// <summary> /// Configure the container with the necessary routes for your ServiceStack application. /// </summary> /// <param name="container">The built-in IoC used with ServiceStack.</param> public override void Configure(Container container) { //Permit modern browsers (e.g. Firefox) to allow sending of any REST HTTP Method Plugins.Add(new CorsFeature()); SetConfig(new HostConfig { DebugMode = true, }); var config = new AppConfig(new AppSettings()); container.Register(config); if (!Directory.Exists(config.RootDirectory)) { Directory.CreateDirectory(config.RootDirectory); } }
/// <summary> /// Configure the container with the necessary routes for your ServiceStack application. /// </summary> /// <param name="container">The built-in IoC used with ServiceStack.</param> public override void Configure(Container container) { //Permit modern browsers (e.g. Firefox) to allow sending of any REST HTTP Method SetConfig(new EndpointHostConfig { GlobalResponseHeaders = { { "Access-Control-Allow-Origin", "*" }, { "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS" }, }, }); var config = new AppConfig(new ConfigurationResourceManager()); container.Register(config); if (!Directory.Exists(config.RootDirectory)) { Directory.CreateDirectory(config.RootDirectory); } }
/// <summary> /// Configure the container with the necessary routes for your ServiceStack application. /// </summary> /// <param name="container">The built-in IoC used with ServiceStack.</param> public override void Configure(Container container) { //ServiceStack.Text.JsConfig.IncludeTypeInfo = true; //Permit modern browsers (e.g. Firefox) to allow sending of any REST HTTP Method Plugins.Add(new CorsFeature()); SetConfig(new EndpointHostConfig { DebugMode = true, // DefaultContentType = "text/json", //Change default content type }); //var config = new AppConfig((RestFiles.ServiceInterface.AppConfig.IAppSettings)new AppSettings()); //container.Register(config); //Register Typed Config some services might need to access //var appSettings = new AppSettings(); //var config = new AppConfig(new AppSettings()); var config = new AppConfig(new ConfigurationResourceManager()); container.Register(config); container.Register(config); container.Register(config); //All Registrations and Instances are singleton by default in Funq FingerprintDatabase = new FingerprintDatabase(); container.Register(FingerprintDatabase); // List<MyPerson> database = PersonList.GetPersonListAsync(); Task database = GetPersonListAsync(container); // container.Register(database); if (!Directory.Exists(config.RootDirectory)) { Directory.CreateDirectory(config.RootDirectory); } }