Questions tagged [nancy]

Nancy is a lightweight web framework for the .Net platform, inspired by Sinatra. Nancy aims to deliver a low ceremony approach to building light, fast web applications.

Nancy is a Sinatra inspired web framework for the .NET platform.

Installation

Nancy can most easily be installed through its NuGet package.

Install-Package Nancy

Resources

1105 questions
50
votes
5 answers

Returning a string containing valid Json with Nancy

I receive a string that contains valid JSON from another service. I would like to just forward this string with Nancy but also set the content-type to "application/json" which will allow me to remove the need for using $.parseJSON(data) on the…
Dave
  • 3,812
  • 5
  • 31
  • 39
40
votes
3 answers

Get url parameters in NancyFx

I am using NancyFx to build a web API, but I am facing some problems when getting parameters from the URL. I need to send, to the API, the request .../consumptions/hourly?from=1402012800000&tags=%171,1342%5D&to=1402099199000 and catch the value of…
user3734857
  • 411
  • 1
  • 4
  • 3
35
votes
2 answers

Benefits of using NancyFx?

There is yet another framework for making HTTP calls called NancyFx. My question is what are the benefits of using it. I had quick look at the documentation: https://github.com/NancyFx/Nancy/wiki/Documentation and it looks like there is no…
Jaggu
  • 6,298
  • 16
  • 58
  • 96
31
votes
4 answers

Respond with both body and status code in Nancy

I'm new to Nancy and I want to return both a custom HttpStatusCode and a body (content). If I return an HttpStatusCode, it returns it with a blank body. If I return a string then it returns that as the body but always with a 200 status code of…
Sachman Bhatti
  • 333
  • 1
  • 3
  • 9
29
votes
3 answers

Self hosted OWIN and urlacl

I've created a self hosted Nancy/SignalR application self-hosted in OWIN using Microsoft.Owin.Host.HttpListener and Microsoft.Owin.Hosting Things work perfectly fine locally but as soon as I try to use anything but localhost to access the app I get…
kay.one
  • 7,622
  • 6
  • 55
  • 74
28
votes
5 answers

How to serve static content in Nancy

I'm having trouble serving up static content such as JavaScript in Nancy. For example using the self hosting sample I have added a test.js to the Views folder and added a tag to the…
Ian Oakes
  • 10,153
  • 6
  • 36
  • 47
27
votes
3 answers

Is it possible to enable CORS using NancyFX?

I have an API service made with NancyFX, and a couple of front-end developers creating an SPA JS client against this API. We would like to test the client side code against the published server without having to publish the client code with too…
Alberto Basalo
  • 273
  • 1
  • 4
  • 5
26
votes
5 answers

Nancy (C#): How do I get my post data?

I'm using Corona SDK to post data to my C# server: headers["Content-Type"] = "application/x-www-form-urlencoded" headers["Accept-Language"] = "en-US" local body = "color=red&size=small" local params = {} params.headers = headers params.body =…
Westerlund.io
  • 2,743
  • 5
  • 30
  • 37
25
votes
3 answers

Unable to map an HttpHandler to a "path/*" wildcard mapping

So I've been trying to map an http module to a sub-path of an MVC3 site. It should be pretty simple as I understand it, but it has not been working. The module is setup like so:
Chris Nicola
  • 14,384
  • 6
  • 47
  • 61
23
votes
1 answer

Nancy Self Host doesn't call Module?

I am working on adding Nancy Framework to my C# console application (followed the very short tutorial here and it loads a blank page when I go to http://localhost:1234 so I know it is starting, but it doesn't show my text properly. I have gone over…
user470760
21
votes
2 answers

How should I handle authentication with Nancy?

I started coding a LoginModule for Nancy, but it occurred to me that possibly I need to perform authentication a different way. Is there an accepted way of doing auth in Nancy? I am planning two projects right now: web and json service. I will need…
Byron Sommardahl
  • 12,743
  • 15
  • 74
  • 131
21
votes
1 answer

SignalR plus NancyFX : A simple but well worked example

There are a few examples of NancyFX being integrated with SignalR, for example Signalr & Nancyfx integration Since I am just starting out I want a simple, well worked canonical example that I can work from. A nancy version of the chat example from…
biofractal
  • 18,963
  • 12
  • 70
  • 116
21
votes
5 answers

NancyFx and Windows Authentication

I want to use NancyFx for an intranet web app. All the documentation and forums only mention Forms and Basic authentication. Anyone successfully use Nancy with Windows Authentication? There's also something called Nancy.Authentication.Stateless but…
PPC-Coder
  • 3,522
  • 2
  • 21
  • 30
20
votes
3 answers

How to make an image handler in NancyFx

I'm struggling to output an Image from byte[] out of my database in NancyFX to a web output stream. I don't have sample code close enough to even show at this point. I was wondering if anyone has tackled this problem and could post a snippet? I…
sethxian
  • 276
  • 2
  • 11
19
votes
3 answers

Disabling ASP.NET HttpHandler response caching

Background I'm in the midst of comparing the performance of NancyFx and ServiceStack.NET running under IIS 7 (testing on a Windows 7 host). Both are insanely fast - testing locally each framework processes over 10,000+ req/sec, with ServiceStack…
Kevin Pullin
  • 13,122
  • 3
  • 24
  • 33
1
2 3
73 74