Last active
January 4, 2016 08:29
-
-
Save atrauzzi/8595555 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Nancy; | |
public class IndexModule : NancyModule { | |
// What would be neat is if I could teach Nancy new ways of handling the right side of routes. | |
public IndexModule() { | |
Get["/"] = typeof(MyProject.Controller.Home); | |
// This would perhaps run a standard method found on the class after instantiating it. | |
Get["/user/profile"] = {typeof(MyProject.Controller.User), "some way of indicating the method to run"}; | |
// This would run a specific method on the class after instantiating it. | |
// Handling code to would still be run "late" (as with lambdas) because the resolver would use my IoC. | |
// Only dependencies necessary for fulfilling the current request (defined in the controller) would be | |
// instantiated. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment