Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active June 30, 2021 07:13
Show Gist options
  • Save gistlyn/6ac54b2ad298dff2cfae8552f8054dd6 to your computer and use it in GitHub Desktop.
Save gistlyn/6ac54b2ad298dff2cfae8552f8054dd6 to your computer and use it in GitHub Desktop.
formats
public class AppHost : AppHostBase
{
public AppHost() : base("Web",typeof(MyServices).Assembly){}
public override void Configure(Container container)
{
// Add additional format support by using Plugins
Plugins.Add(new MsgPackFormat());
}
}
public class MyServices : Service
{
// HTML, JSON, CSV, XML and JSV enabled by default
public object Any(Hello request) =>
new HelloResponse {
Result = $"Hello, {request.Name}"
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment