Skip to content
forked from Anna-Rx/Anna

Event-driven http server library with ReactiveExtensions inspired in node.js and nancy

Notifications You must be signed in to change notification settings

glitchdotcom/Anna

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anna

Anna is an event-driven HTTP server library built with ReactiveExtensions (Rx). Anna was inspired in Node.js and Nancy.

Anna exposes observable sequences of HTTP requests to which you can subscribe to handle the request.

using (var server = new HttpServer("http://*:1234/"))
{
    // simple basic usage, all subscriptions will run in a single event-loop
    server.GET("/hello/{Name}")
          .Subscribe(ctx => ctx.Respond("Hello, " + ctx.Request.UriArguments.Name + "!"));

    // use Rx LINQ operators
    server.POST("/hi/{Name}")
          .Where(ctx => ctx.Request.UriArguments.Name == "George")
          .Subscribe(ctx => ctx.Respond("Hi, George!"));

    server.POST("/hi/{Name}")
          .Where(ctx => ctx.Request.UriArguments.Name == "Pete")
          .Subscribe(ctx => ctx.Respond("Hi, Pete!"));
}

About

Event-driven http server library with ReactiveExtensions inspired in node.js and nancy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%