Skip to content

Instantly share code, notes, and snippets.

@abjurato
Created May 2, 2016 06:58
Show Gist options
  • Save abjurato/f4b35d88052de398c2b1dd36df44c013 to your computer and use it in GitHub Desktop.
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.
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