Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created January 18, 2018 01:08
Show Gist options
  • Save dcomartin/e82c5efb59270c76a4d0c60e29749a7e to your computer and use it in GitHub Desktop.
Save dcomartin/e82c5efb59270c76a4d0c60e29749a7e to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddCors();
services.AddMvc(options =>
{
var templates = new Dictionary<Type, object>
{
{ typeof(GameResponse), new GameSirenResponse() }
};
options.OutputFormatters.Add(new SirenOutputFormatter(templates));
});
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "Hangman Api v1.0", Version = "v1" });
c.IncludeXmlComments("wwwroot/Hangman.Api.xml");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment