36

Does anyone know if there is a .NET library/API similar to Ruby's Sinatra?

Just wondering since with the new Routing API in ASP.NET MVC, WCF and .NET 3.5, it seems like a possibility.

UPDATED: Best answer link is stale so check out Nancy @ https://github.com/NancyFx/Nancy

kenny
  • 21,522
  • 8
  • 49
  • 87
  • 1
    The latest release of IronRuby (1.1.2) has a Visual Studio template called "Sinatra Web Application" - so it looks like it's possible to utilize Sinatra from within IronRuby. – Roy Tinker Feb 22 '11 at 18:43
  • @Roy Tinker, interesting. Thanks for the update. I'm still interested in Nancy, since I still prefer C# at least today... I like Ruby too, but for real projects I prefer a statically checked language. – kenny Feb 23 '11 at 00:40

5 Answers5

33

There is a new framework called Nancy for .NET which is inspired by Sinatra and looks promising. But it is still in a very early state.

You can read more about it here: http://elegantcode.com/2010/11/28/introducing-nancy-a-lightweight-web-framework-inspired-by-sinatra/ and

Malice
  • 3,927
  • 1
  • 36
  • 52
Tobias
  • 1,938
  • 16
  • 12
  • Tobias, very cool thanks. That's what I'm talking about. I'll try it out when I find some time. – kenny Dec 06 '10 at 18:11
  • 3
    Hey. I am the guy behind Nancy. Since the introduction there's been quite a lot of work going on. Soon we'll support Razor, Spark, NHaml and NDjango (as well as static contents) views out of the box, added more hosts etc. There are daily commits in the repository. Thanks! – TheCodeJunkie Dec 15 '10 at 14:12
22

There seems to be a host of these micro web frameworks on .NET now:

Nancy: Here is a HanselMinutes podcast with the creator Andreas Håkansson
Nina: "Nina is a web microframework for the .Net platform, inspired by Sinatra"
Kayak: "Kayak is an asynchronous HTTP server written in C#"
Manos: Interview with the creator Jackson Harper on Hearding Code
Jessica is "a micro web framework written out of curiosity in .NET, inspired by Ruby's Sinatra."

There is good blog article by Mike Hadlow where I picked up the above links and he goes into good detail on each. Just thought I'd shoutout these projects, it's exciting to see such development in the .NET world.

Ameer Deen
  • 704
  • 8
  • 20
10

You may also want to check out OpenRasta. It is a nice, clean REST framework. I don't know if it uses the MS routing libraries or not, but from what I can tell it's routing syntax is very similar, if not identical. Also, it looks like IronRuby is capable of running Sinatra and Rack now, and the IronRuby website has instructions for getting it up and running, so an alternative may not be required if you want to run Sinatra in a .NET environment.

Nathan
  • 12,290
  • 3
  • 29
  • 28
  • Will do Nathan...I've looked at OpenRasta briefly in the past and my impression was that it wasn't as simple and clean as Sinatra seems. IronRuby seems to be still baking...but a good point. Thanks. – kenny Oct 03 '09 at 14:41
  • Well, OpenRasta isn't quite the same as Sinatra - there definitely are more moving parts if you use it as intended. IronRuby isn't totally finished but it is pretty close to a 1.0 I believe, and I was able to get the latest version of Sinatra running in about 10 minutes. The IronRuby site has instructions on hosting Rack in IIS, so I think there is a good chance you could start writing production Sinatra apps today if you wanted to. I don't think you'll find a native .NET project that is straightforward or un-opinionated as Sinatra, due to language and culture differences. – Nathan Oct 03 '09 at 19:08
  • 1
    If there's things you find too complicated on OpenRasta, we'd love the feedback. – SerialSeb Oct 22 '09 at 23:54
4

It seems that the Martin framework is inspired by Sinatra, but it is not a port. It does use the new routing API that you mentioned though.

Cᴏʀʏ
  • 105,112
  • 20
  • 162
  • 194
3

You can test Manos https://github.com/jacksonh/manos is a lightweight framework based in Sinatra.

I've not found the Nancy Framework, can you give me the correct url ?

eaguilar
  • 87
  • 1
  • 2