From f7b15167d712c06bbdf51150f9b12035959a48ad Mon Sep 17 00:00:00 2001 From: Qiaosen Huang Date: Thu, 25 Feb 2016 21:21:44 +0800 Subject: [PATCH] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c04ecb5..798bfdb 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,13 @@ class UserRoute extends Controller { constructor() { super(); + //The controller will be created upon each request, so it is safe to initialize variables here for all other routes. + this.user = getFromMemoryCache(); } @Before async getUserBeforeAll(@PathParam('_id') userId:string) { - this.userId = await dbAction({_id: this.userId}); + this.user = await dbAction({_id: this.userId}); } @Path('/:_id')