Dos - Step 1
For this project, we'll also start with project.json, bringing in the dependencies we'll need.
1: 2: 3: 4: 5: |
|
Nancy strives to provide a Super-Duper-Happy-Path (SDHP), where all you have to do is follow their conventions, and everything will "just work." (You can also configure every aspect of it; it's only opinionated in its defaults.) One of these conventions is that the controllers inherit from NancyModule, and when they do, no further configuration is required. So, we create the Modules directory, and add HomeModule.cs, which looks like this:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: |
|
Since we'll be hosting this with Kestrel (via OWIN), we still need a Startup.cs, though its Configure() method looks a bit different:
1: 2: |
|
(We need to add a using statement for Nancy.Owin so that the UseNancy() method is visible.)
The App.cs file is identical to the one from Uno.