This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
public override void Configure(Container container) | |
{ | |
// Feature Plugin with default configuration | |
Plugins.Add(new ValidationFeature()); | |
// Feature Plugin with custom configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
// Configure your AppHost with the necessary configuration | |
// and dependencies your App needs | |
public override void Configure(Container container) | |
{ | |
container.Register<IBar>(new Bar { | |
Name = "Registered as interface" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyServices : Service | |
{ | |
public object Any(Hello request) | |
{ | |
return new HelloResponse { | |
Result = $"Hello, {request.Name}!" | |
}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
export class HelloApi extends Vue { | |
@Prop() public name: string; | |
public txtName: string = ''; | |
public result: string = ''; | |
public mounted() { | |
this.nameChanged(this.name); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseUrl = "https://web.web-templates.io"; | |
var client = new JsonServiceClient(baseUrl); | |
var response = client.Get(new Hello { Name = "World!" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CacheResponse(Duration = 60 * 60, MaxAge = 30 * 60)] | |
public class CachedServices : Service | |
{ | |
public object Get(CachedGetAllCustomers request) => | |
Gateway.Send(new GetAllCustomers()); | |
public object Get(CachedGetCustomerDetails request) => | |
Gateway.Send(new GetCustomerDetails { Id=request.Id }); | |
public object Get(CachedGetOrders request) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
public override void Configure(Container container) | |
{ | |
var awsDb = new AmazonDynamoDBClient( | |
Secrets.AWS_ACCESS_KEY, | |
Secrets.AWS_SECRET_KEY, | |
RegionEndpoint.USEast1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web", | |
typeof(MyServices).Assembly) { } | |
public override void Configure(Container container) | |
{ | |
container.Register<IRedisClientsManager>(c => | |
new RedisManagerPool("localhost:6379")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ServiceStack; | |
namespace MyApp | |
{ | |
public class ConfigureCors : IConfigureAppHost | |
{ | |
public void Configure(IAppHost appHost) | |
{ | |
appHost.Plugins.Add(new CorsFeature()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License BSD https://github.com/ServiceStack/servicestack-client/blob/master/LICENSE.txt | |
// Partial AppConfig used by ArchiveServices.cs | |
public class AppConfig | |
{ | |
public Dictionary<string, HashSet<string>> TemplateMixMap { get; set; } = new(); | |
} | |
public class AppHost : AppHostBase | |
{ |