Skip to content

Instantly share code, notes, and snippets.

@thiagoloureiro
Last active May 12, 2018 19:05
Show Gist options
  • Select an option

  • Save thiagoloureiro/5ff87045414a15a160e28d5bc3b625a0 to your computer and use it in GitHub Desktop.

Select an option

Save thiagoloureiro/5ff87045414a15a160e28d5bc3b625a0 to your computer and use it in GitHub Desktop.
public sealed class MessageBrokerModule : NancyModule
{
public MessageBrokerModule()
{
Get("/", args => "Service Status OK");
Post("/", args =>
{
var obj = this.BindAndValidate<RootObject>();
if (!this.ModelValidationResult.IsValid)
return 422;
var objRabbit = new MessageBroker();
objRabbit.WriteMessageOnQueue("AppVeyor", JsonConvert.SerializeObject(obj));
return obj;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment