Skip to content

Instantly share code, notes, and snippets.

@AlbertoMonteiro
Created January 28, 2015 11:30
Show Gist options
  • Select an option

  • Save AlbertoMonteiro/20d8a8d667d764acca0f to your computer and use it in GitHub Desktop.

Select an option

Save AlbertoMonteiro/20d8a8d667d764acca0f to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using Microsoft.Owin.Hosting;
using Nancy;
using Owin;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var url = "http://+:8080";
using (WebApp.Start<Startup>(url))
{
Console.WriteLine("Running on {0}", url);
Console.WriteLine("Press enter to exit");
Console.ReadLine();
}
}
}
public class HelloModule : NancyModule
{
public HelloModule()
{
Get["/", true] = async (x, ct) => await Task.FromResult("hello");
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseNancy();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment