Where are plug-ins supposed to be added in ServiceStack

alfarolex

New Member
So simple yet I can't find any info or examples that explain exacty where this should happen. I'm guessing at this point that it should be in the Configure method.Thank you,StephenGlobal\[code\]public class AppHost : AppHostBase{ public AppHost() : base("rDesk UPP Web Services", typeof(ContactsService).Assembly) { } public override void Configure(Container container) { //Set JSON web services to return idiomatic JSON camelCase properties ServiceStack.Text.JsConfig.EmitCamelCaseNames = true; //Show StackTrace in Web Service Exceptions SetConfig(new EndpointHostConfig { DebugMode = true }); //Register any dependencies you want injected into your services container.Register<ICacheClient>(new MemoryCacheClient());/* // Redis container.Register<IRedisClientsManager>(c => new PooledRedisClientManager()); container.Register<IRepository>(c => new Repository(c.Resolve<IRedisClientsManager>()));*/ container.Register<IRepository>(new Repository()); container.Register<IBusinessService>(new BusinessService()); //Configure Custom User Defined REST Paths for your services /*ConfigureServiceRoutes();*/ //Add a request filter to check if the user has a session initialized /*this.RequestFilters.Add((httpReq, httpResp, requestDto) => { var sessionId = httpReq.GetCookieValue("user-session"); if (sessionId == null) { httpResp.ReturnAuthRequired(); } });*/ RequestFilters.Add((httpReq, httpResp, requestDto) => new LogRequestAttribute().Execute(httpReq, httpResp, requestDto)); Plugins.Add(new SwaggerFeature()); } public static void Start() { new AppHost().Init(); }}\[/code\]
 
Back
Top