Created
May 2, 2016 06:58
-
-
Save abjurato/f4b35d88052de398c2b1dd36df44c013 to your computer and use it in GitHub Desktop.
Required global function to make Perfect work. Swift, Perfect, mustache and PostgreSQL on Heroku.
This file contains 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
import PerfectLib | |
// This function is required. The Perfect framework expects to find this function | |
// to do initialization | |
public func PerfectServerModuleInit() { | |
PageHandlerRegistry.addPageHandler("CatName") { | |
// This closure is called in order to create the handler object. | |
// It is called once for each relevant request. | |
// The supplied WebResponse object can be used to tailor the return value. | |
// However, all request processing should take place in the `valuesForResponse` function. | |
(r:WebResponse) -> PageHandler in | |
return CatNameHandler() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment