public HomeModule(IGreeterService greeter) { Get("/", args => { return(View["index.html", greeter.GetGreeting()]); }); Get("/test", args => greeter.GetGreeting()); Get("/os", x => { return(System.Runtime.InteropServices.RuntimeInformation.OSDescription); }); }
public HomeModule(IGreeterService greeter) { //https://blog.nandotech.com/post/2016-10-25-nancyfx-webapi-dapper/ Get("/", args => { return(greeter.GetGreeting()); }); Get("/test", args => greeter.GetGreeting()); Get("/os", x => { return(System.Runtime.InteropServices.RuntimeInformation.OSDescription); }); }
public Task <IHttpResponse> ExecuteAsync(HttpContext context) { IHttpResponse response = new StringResponse(context, _greeterService.GetGreeting()); return(Task.FromResult(response)); }