by romanovcode · 12y ago · 0 comments
Edit: Seems like many do not know about Nancy, check it out, some even say it's better than MVC. The good side is that it's 100% compatible with Mono because they run tests against it too so you can host your C# websites on Linux.
Github: https://github.com/NancyFx/Nancy
https://github.com/NancyFx/Nancy
EDIT: It seems to be a .NET clone of node.js
(Thus the name. Frank Sinatra's daughter is named Nancy Sinatra)
When I open the vsix file, all I get is a hexdump. I also tried installing it as an add-in, but it doesn't appear to accept vsix files.
The goal is to get past step one of these instructions: https://github.com/NancyFx/Nancy/wiki/Introduction
How to make this work, pretty please?
.NET has always been able to do what Node does anyway. It has had HttpListener since v1.0...
When you use a language with real variable types, it's less of an issue... If you really want it, you could shoehorn generators and other db platforms into the hyena[1] package.
In general, I've found that using databases tend to be much more straight forward under node, and that using ORM tools are less necessary.
http://curtis.schlak.com/2014/02/04/setup-asp-net-mvc-4-on-m...
NoWin, Nancy, SignalR & Lego on the raspberry pi:
I'd say there are plenty of alternatives to OWIN (and the .Net stack) for *nix. That's probably why there's not much interest around Mono, too.
SO close...
(as nifty as mvc can possibly be anyway)
public SampleModule() { Get["/"] = _ => "Hello World!"; }
[0] https://github.com/NancyFx/Nancy/wiki/Taking-a-look-at-the-D...
To perhaps clarify a bit, here's what the Hello World example would look like if we added a second route that uses the lambda parameter, and a third route that does something else, and a fourth route that renders a view template.
public SampleModule() {
Get["/"] = _ => "Hello World!";
Get["/hello/{name}"] = p => ("Hello, " + p.name + "!");
Get["/something-complicated"] = _ => {
// complicated stuff happens here
return "OK... we're all done";
};
// A variety of template engines are supported
Get["/my-resume"] = _ => View["resume.cshtml"];
} Get["/"] = _ => "Hello World!";
is actually of the form a = b;Where "a", i.e. "Get["/"]" is an array-like property (http://msdn.microsoft.com/en-us/library/2549tw02.aspx ) and the "b" value assigned to it is an anonymous function with one parameter, i.e.
_ => "Hello World!"
In Nancy these handlers are of the type Func<dynamic, dynamic> ( http://msdn.microsoft.com/en-us/library/bb549151(v=vs.110).a... ) The parameter could be given any legal name, but an underscore is a convention meaning "I am not using this param". public SampleModule()
{
Get["/{id:int}"] = _ =>
{
int id = _.id;
return "Parameter ID is: " + id.ToString();
};
}