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 play.api._ | |
import play.api.mvc._ | |
object Global extends GlobalSettings { | |
def ResponseTime[A](action: Action[A]): Action[A] = Action(action.parser) { request => | |
val start = System.currentTimeMillis | |
val result = action(request) | |
println( request + " -> " + (System.currentTimeMillis - start) + " ms.") | |
result |
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
var getName = require('name').getName; | |
exports.hello = function() { | |
return "Hello " + getName(); | |
}; |